Playgrounds
Snippets
Developers
Compiler
All
ActionScript
Ajax
AngularJS
Apache
AppleScript
ASP.NET
Bash
C
C#
C++
Coffee
CoffeeScript
ColdFusion
Command
CSS
Delphi
Django
ES6
GLSL
Grunt
Gulp
HAML
Haskell
HTML
iOS
Jade
Java
JavaScript
jQuery
JSX
Less
LUA
MDX
MySQL
Objective
Other
Pascal
Perl
PHP
Plain text
PowerShell
Processing
Progress
Prolog
Pseudocode
Python
Rails
RegExr
Ruby
SASS
Scala
Scheme
SCSS
SmallBASIC
Smarty
SQL
Stylus
SVG
Swift
TypeScript
VHDL
X++
XHTML
XML
Xojo
XSLT
New snippet
New playground
Sign up
Login
Upload
Playgrounds
Snippets
Developers
Sign up
Login
Codepad is a place for developers to share code snippets (PHP, Java, Bash, C, C++, Python and more). Create your HTML, CSS and JS Demos.
Sign up
Learn more
Please
Login
or
Register
Wanja Friedemann
Germany, Berlin
72
Followers
194
Snippets
Snippets
Collections
Newest
Oldest
Popular
Most comments
Most views
Sort objects in array by property (Vanilla)
JavaScript
0
0
33
Symlink Windows (mklink)
Bash
0
0
44
Symlink Windows (mklink)
Bash
0
0
31
Smooth Scroll Offset Anchor Links with CSS (SCSS Mixin)
SASS
0
0
58
DOM Ready Loaded
ES6
0
0
52
Efficient function with throttle and debounce
ES6
0
0
47
Debounce
ES6
0
0
59
SCSS Mixin: Calculate color contrast between foreground and background color
SCSS
0
0
101
SCSS Mixin: Hide visually
SCSS
0
0
95
Convert date to another timezone and format to local standards
JavaScript
0
0
112
Twig 3.x BEM modifier from Array
HTML
0
0
110
Get time between dates
JavaScript
0
0
95
Smooth anchor scroll (Vanilla, polyfilled)
JavaScript
0
0
116
Check if an element is a child of another element with a given class name
JavaScript
0
0
117
Makefile self documenting
Plain text
0
0
206
Social Sharing via Link (HTML)
Plain text
0
0
190
Craft CMS 3 - Twig really empty string
Plain text
0
0
225
JS Construct for jQuery Component
JavaScript
0
0
224
Import jQuery in ES6
JavaScript
0
0
248
Craft CMS 3 - Empty Trash via CLI
Plain text
0
0
283
Craft CMS 3 - Backup Database via CLI
Plain text
0
0
192
Craft CMS 3 - Asset (Twig)
Plain text
0
0
243
Craft CMS 3 - Entry URI Format
Plain text
0
0
275
Craft CMS 3 - Password reset SQL
Plain text
0
0
309
Gulpfile ES6 to ES5 (including Dependencies, tested ✔︎)
JavaScript
0
0
202
YouTube iframe with cross-browser autoplay and enhanced privacy features (DSGVO)
HTML
0
0
269
Gulp SCSS to CSS
JavaScript
0
0
242
Vanilla JS Debouncing Header (hide on scrollDown and show on scrollUp)
0
0
268
Browserslistrc
Plain text
0
0
220
Reset & Normalize SCSS
SCSS
0
0
273
Twig chaining
Plain text
0
0
196
Prettierrc Setup for VS Code and Prettier
JavaScript
0
0
277
Gulp (4.x) File that just works (including npm dependencies and webp-Support)
JavaScript
0
0
368
Stylelintrc Setup for VS Code and Prettier
JavaScript
0
0
1102
React: Call Function with Parameters in onClick Event
JSX
0
0
249
macOS QuickLook Markdown Support
Bash
0
0
176
Strato SSH
Bash
0
0
310
ssh-copy-id Workaround
Bash
1
0
241
Add "npm browserslist" for Genesis Child Theme (e.g.: IE 10+)
JavaScript
0
0
270
Wordpress Theia Smart Thumbnails (Pro): Remove Account / Change License
Plain text
0
0
319
Import SQL-File to Table with MySQL from Command Line
Plain text
0
0
238
WP Title (Browser-Tab, <title></title>) with document_title_parts (Yoast SEO Fallback)
PHP
0
0
322
SCP Local to Remote via SSH
Bash
0
0
222
Remove Widget Title
PHP
0
0
274
Global gitignore
Bash
0
0
266
SSH enable umlauts
Bash
0
0
314
WP Query with taxonomy
PHP
0
0
278
Copy SSH Key
Bash
0
0
244
Bash: Remove Files with Regex
Bash
0
0
382
git-ftp deploy
Bash
0
0
281
Remove Folder with content
Bash
0
0
240
WP Debug
PHP
0
0
318
Linkify and Advanced Custom fields: Link all WP Authors/Users
PHP
0
1
311
Linkify Text and Advanced Custom Fields
PHP
0
0
418
Git remove cached file (after .gitignore update)
Bash
0
0
326
Covert LaTex (.tex) to Markdown (.md)
Plain text
0
0
404
Turn colors of png to white
CSS
0
0
249
Fix Joomla SqueezeBox - Expandable Lightbox positioning
Plain text
0
0
513
LaTex: break inside multicolumn layout (column-break)
Plain text
0
0
595
LaTex custom Page Layout and size (in mm with margin and padding)
Plain text
0
0
388
LaTex listings Syntax highlighting for HTML5
Plain text
0
0
564
LaTex bibliography 'natbib' (Harvard) fix for URLs Lastchecked
Plain text
0
0
442
LaTex text reference
Plain text
0
0
376
LaTex white-space: nowrap
Plain text
0
0
450
LaTex Blocksatz, Flattersatz und Rauhsatz
Plain text
0
0
556
LaTex Table
Plain text
0
0
685
Contactform Checkbox DSGVO (de_DE)
Plain text
0
0
681
Terminal: Quit a list of programs from the Shell
Bash
0
0
294
Terminal: Open list of programs
Bash
0
0
293
LaTex reference with BibDesk: multiple authors
Plain text
0
0
577
LaTex Chinese
Plain text
0
0
372
LaTex Columns
Plain text
0
0
395
LaTex remove empty pages caused by \chapter
Plain text
0
0
598
LaTex Images
Plain text
0
0
1134
LaTex Cites Harvard
Plain text
0
0
424
LaTex config file (index.tex)
Plain text
0
0
990
How to LaTex on MacOS with Atom.io in 10 easy steps
Plain text
0
0
647
German Date from array
PHP
0
0
316
Get URL_HOST (domain) from URL
Smarty
0
0
449
QR Code Google API
HTML
0
0
473
Sort Array by date
PHP
0
0
445
YouTube & Vimeo Integration with Thumbnail (oEmbed)
PHP
0
0
498
Remove index.php or index.htm/html from URL requests
Apache
0
0
667
403 deny from all
Apache
0
0
379
YouTube Thumbnails from ID
Plain text
0
0
590
.htaccess Force trailing slash
Apache
0
0
468
.htaccess Disable trailing slash
Apache
0
0
473
.htaccess Rewrite rule: single GET Parameter
Apache
0
0
544
My favorite Colors
Plain text
0
0
434
ISO 8601 date with Smarty
Smarty
0
0
978
.htaccess http to https
Apache
0
0
461
.htaccess www to non www
Apache
0
0
428
date_format
Smarty
0
0
461
The thing about responsive images
0
0
446
Serve localhost: SimpleHTTPServer
Python
0
0
363
Next Monday PHP
PHP
0
0
577
Change stuff on scroll position
0
0
447
Find ISO 3166-1 alpha-2 country code
PHP
0
0
664
Arduino LED 'blink'
C
0
0
613
Arduiono LED 'switch'
C
0
0
466
Arduino LED 'press and hold'
C
0
0
468
CSS Flexbox **flex-wrap** fix last item
0
0
511
Play Video depending on scroll position
0
1
961
Parse URL with Smarty
Smarty
0
0
1181
Unzip PHP
PHP
0
0
523
Smarty Array: array_reverse
Smarty
0
0
997
Fancy gradient
0
0
541
JavaScript Progress Bar
0
0
630
Smarty Array Articles Anywhere
Smarty
1
0
1254
Smooth anchor scroll
0
2
710
Moving background image onMouseover
0
5
695
Windows or Mac/Linux | jQuery
jQuery
0
2
555
Get known Wi-Fi Network password
Bash
0
2
698
Joomla Cloak Mailto Link
PHP
0
2
1024
Contenteditable HTML
HTML
0
1
557
Smarty foreach with counter
Smarty
0
9
1761
PHP Switch: example opening times
PHP
0
1
600
Facebook API: Fetch events from Page as decoded JSON (Object)
PHP
1
3
1946
Flexbox Layout responsive
1
5
735
Ultimate responsive flex grid
0
8
701
Clone value of input field in real time
0
1
748
Fakeloader / Page loader with data
0
3
712
Animated countdown/up
0
3
671
Vimeo or YouTube ID ? + Responsive Video Wrapper for IFRAME
PHP
0
1
986
Form2Content Joomla: Javascript in Textarea
Smarty
0
1
813
Get Vimeo ID from URL / API
PHP
0
2
1758
5 PHP short If / Else (PHP 7.x: kurze If / Else - Abfrage)
PHP
0
8
1174
Animate Count To Value
jQuery
0
5
680
Get IP Address
PHP
2
11
1087
Joomla get date from article and format
PHP
0
2
1229
Cut string after X char and add ... points
PHP
0
1
883
Inverse HEX Value with PHP
PHP
0
9
1141
Fix Joomla 3x Logout
PHP
0
8
1172
E-Mail Validaton with specific Domain
JavaScript
0
5
628
URL Rewrite Match Replace Tail PHP
PHP
0
8
1198
YouTube IFRAME Mobile Safari Fix
HTML
0
8
717
Function addhttp: Add HTTP to Hyperlink if not exists
PHP
0
9
590
Soundcloud JSON from URL
PHP
0
7
1088
Let's go Fullscreen
HTML
0
8
750
CSS select text user-select
CSS
0
7
884
Form2Content Joomla: Load module in .tpl
Smarty
1
1
1223
YOUTUBE_ID
PHP
0
1
705
Refresh (HTML)
HTML
0
2
897
PDO Array Komma getrennt // Output comma separated array from PDO table
PHP
0
1
903
connect.inc.php
PHP
0
0
823
default.css
CSS
0
0
2465
Add most basic but missing function to Javascript
JavaScript
0
0
317
default.php
PHP
0
0
1712
Insert Content into DIV
jQuery
0
0
890
jQuery: on click toggle
jQuery
0
0
1084
Generate random string
PHP
0
0
945
PHP | Media Query for Mobile Devices
PHP
0
0
771