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
Max Mustermann
Finland,
73
Followers
193
Snippets
Snippets
Collections
Newest
Oldest
Popular
Most comments
Most views
Get IP Address
PHP
2
12
1679
Smarty foreach with counter
Smarty
0
9
2987
Function addhttp: Add HTTP to Hyperlink if not exists
PHP
0
9
1060
Inverse HEX Value with PHP
PHP
0
9
1689
Ultimate responsive flex grid
0
8
1193
CSS select text user-select
CSS
0
8
1472
Let's go Fullscreen
HTML
0
8
1218
YouTube IFRAME Mobile Safari Fix
HTML
0
8
1168
URL Rewrite Match Replace Tail PHP
PHP
0
8
1832
Fix Joomla 3x Logout
PHP
0
8
1802
5 PHP short If / Else (PHP 7.x: kurze If / Else - Abfrage)
PHP
0
8
2272
Soundcloud JSON from URL
PHP
0
7
1742
Flexbox Layout responsive
1
5
1190
Moving background image onMouseover
0
5
1169
E-Mail Validaton with specific Domain
JavaScript
0
5
1127
Animate Count To Value
jQuery
0
5
1140
Animated countdown/up
0
3
1113
Fakeloader / Page loader with data
0
3
1155
Facebook API: Fetch events from Page as decoded JSON (Object)
PHP
1
3
2808
Get Vimeo ID from URL / API
PHP
0
2
2883
Refresh (HTML)
HTML
0
2
1347
Joomla get date from article and format
PHP
0
2
2187
Joomla Cloak Mailto Link
PHP
0
2
1626
Windows or Mac/Linux | jQuery
jQuery
0
2
1026
Get known Wi-Fi Network password
Bash
0
2
1179
Smooth anchor scroll
0
2
1148
YouTube iframe with cross-browser autoplay and enhanced privacy features (DSGVO)
HTML
0
0
854
Play Video depending on scroll position
0
1
4026
Craft CMS 3 - Password reset SQL
Plain text
0
0
1250
Contenteditable HTML
HTML
0
1
979
Form2Content Joomla: Javascript in Textarea
Smarty
0
1
1481
Craft CMS 3 - Backup Database via CLI
Plain text
0
0
699
Import jQuery in ES6
JavaScript
0
0
800
JS Construct for jQuery Component
JavaScript
0
0
696
Vimeo or YouTube ID ? + Responsive Video Wrapper for IFRAME
PHP
0
1
1560
Clone value of input field in real time
0
1
1203
Social Sharing via Link (HTML)
Plain text
0
0
724
Form2Content Joomla: Load module in .tpl
Smarty
1
1
2023
PDO Array Komma getrennt // Output comma separated array from PDO table
PHP
0
1
1416
Cut string after X char and add ... points
PHP
0
1
1458
Linkify and Advanced Custom fields: Link all WP Authors/Users
PHP
0
1
852
PHP Switch: example opening times
PHP
0
1
1030
YOUTUBE_ID
PHP
0
1
1208
PHP | Media Query for Mobile Devices
PHP
0
1
1299
Reset & Normalize SCSS
SCSS
0
0
1041
Browserslistrc
Plain text
0
0
763
Gulp SCSS to CSS
JavaScript
0
0
817
React: Call Function with Parameters in onClick Event
JSX
0
0
850
Gulpfile ES6 to ES5 (including Dependencies, tested ✔︎)
JavaScript
0
0
740
Smarty Array Articles Anywhere
Smarty
1
0
2146
Get time between dates
JavaScript
0
0
612
.htaccess Disable trailing slash
Apache
0
0
961
.htaccess Force trailing slash
Apache
0
0
1048
Import SQL-File to Table with MySQL from Command Line
Plain text
0
0
721
Bash: Remove Files with Regex
Bash
0
0
1740
Wordpress Theia Smart Thumbnails (Pro): Remove Account / Change License
Plain text
0
0
914
Twig 3.x BEM modifier from Array
HTML
0
0
625
Change stuff on scroll position
0
0
898
How to LaTex on MacOS with Atom.io in 10 easy steps
Plain text
0
0
1476
Symlink Windows (mklink)
Bash
0
0
590
Craft CMS 3 - Entry URI Format
Plain text
0
0
998
Symlink Windows (mklink)
Bash
0
0
565
Find ISO 3166-1 alpha-2 country code
PHP
0
0
1470
Remove index.php or index.htm/html from URL requests
Apache
0
0
1490
LaTex config file (index.tex)
Plain text
0
0
2109
date_format
Smarty
0
0
968
YouTube & Vimeo Integration with Thumbnail (oEmbed)
PHP
0
0
1064
Craft CMS 3 - Asset (Twig)
Plain text
0
0
872
Convert date to another timezone and format to local standards
JavaScript
0
0
872
Git remove cached file (after .gitignore update)
Bash
0
0
838
LaTex Cites Harvard
Plain text
0
0
925
Add "npm browserslist" for Genesis Child Theme (e.g.: IE 10+)
JavaScript
0
0
813
Insert Content into DIV
jQuery
0
0
1534
Craft CMS 3 - Empty Trash via CLI
Plain text
0
0
827
Debounce
ES6
0
0
581
Craft CMS 3 - Twig really empty string
Plain text
0
0
719
Sort objects in array by property (Vanilla)
JavaScript
0
0
570
default.css
CSS
0
0
3777
connect.inc.php
PHP
0
0
1314
Check if an element is a child of another element with a given class name
JavaScript
0
0
754
.htaccess www to non www
Apache
0
0
886
.htaccess http to https
Apache
0
0
919
ISO 8601 date with Smarty
Smarty
0
0
2046
Contactform Checkbox DSGVO (de_DE)
Plain text
0
0
1438
Arduino LED 'press and hold'
C
0
0
962
LaTex white-space: nowrap
Plain text
0
0
1026
Arduiono LED 'switch'
C
0
0
952
LaTex Images
Plain text
0
0
2382
Efficient function with throttle and debounce
ES6
0
0
610
Arduino LED 'blink'
C
0
0
1253
DOM Ready Loaded
ES6
0
0
595
LaTex remove empty pages caused by \chapter
Plain text
0
0
1441
Fix Joomla SqueezeBox - Expandable Lightbox positioning
Plain text
0
0
1255
Global gitignore
Bash
0
0
838
LaTex text reference
Plain text
0
0
876
My favorite Colors
Plain text
0
0
915
LaTex Columns
Plain text
0
0
948
Sort Array by date
PHP
0
0
924
LaTex bibliography 'natbib' (Harvard) fix for URLs Lastchecked
Plain text
0
0
945
Copy SSH Key
Bash
0
0
758
WP Debug
PHP
0
0
872
Add most basic but missing function to Javascript
JavaScript
0
0
742
Smooth Scroll Offset Anchor Links with CSS (SCSS Mixin)
SASS
0
0
809
Covert LaTex (.tex) to Markdown (.md)
Plain text
0
0
905
Remove Folder with content
Bash
0
0
672
git-ftp deploy
Bash
0
0
778
SCSS Mixin: Hide visually
SCSS
0
0
680
SCSS Mixin: Calculate color contrast between foreground and background color
SCSS
0
0
966
Smarty Array: array_reverse
Smarty
0
0
1740
Serve localhost: SimpleHTTPServer
Python
0
0
836
The thing about responsive images
0
0
866
Linkify Text and Advanced Custom Fields
PHP
0
0
1060
.htaccess Rewrite rule: single GET Parameter
Apache
0
0
1165
Remove Widget Title
PHP
0
0
835
Stylelintrc Setup for VS Code and Prettier
JavaScript
0
0
3050
WP Query with taxonomy
PHP
0
0
775
YouTube Thumbnails from ID
Plain text
0
0
1188
Next Monday PHP
PHP
0
0
1077
Gulp (4.x) File that just works (including npm dependencies and webp-Support)
JavaScript
0
0
1574
SCP Local to Remote via SSH
Bash
0
0
679
LaTex Chinese
Plain text
0
0
893
Turn colors of png to white
CSS
0
0
722
Get URL_HOST (domain) from URL
Smarty
0
0
986
LaTex reference with BibDesk: multiple authors
Plain text
0
0
1093
Terminal: Open list of programs
Bash
0
0
751
Terminal: Quit a list of programs from the Shell
Bash
0
0
765
WP Title (Browser-Tab, <title></title>) with document_title_parts (Yoast SEO Fallback)
PHP
0
0
932
Makefile self documenting
Plain text
0
0
761
SSH enable umlauts
Bash
0
0
832
default.php
PHP
0
0
2731
ssh-copy-id Workaround
Bash
1
0
852
Strato SSH
Bash
0
0
996
QR Code Google API
HTML
0
0
990
Smooth anchor scroll (Vanilla, polyfilled)
JavaScript
0
0
613
macOS QuickLook Markdown Support
Bash
0
0
658
403 deny from all
Apache
0
0
893
JavaScript Progress Bar
0
0
1106
LaTex Table
Plain text
0
0
1520
LaTex Blocksatz, Flattersatz und Rauhsatz
Plain text
0
0
1407
Fancy gradient
0
0
995
Prettierrc Setup for VS Code and Prettier
JavaScript
0
0
856
LaTex custom Page Layout and size (in mm with margin and padding)
Plain text
0
0
1024
CSS Flexbox **flex-wrap** fix last item
0
0
923
LaTex: break inside multicolumn layout (column-break)
Plain text
0
0
1177
Twig chaining
Plain text
0
0
678
jQuery: on click toggle
jQuery
0
0
1701
Unzip PHP
PHP
0
0
991
German Date from array
PHP
0
0
734
Vanilla JS Debouncing Header (hide on scrollDown and show on scrollUp)
0
0
1015
Parse URL with Smarty
Smarty
0
0
2065
LaTex listings Syntax highlighting for HTML5
Plain text
0
0
1329