This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| (function () { | |
| // Avoid double-injection | |
| if (window.__confettiRunning) return; | |
| window.__confettiRunning = true; | |
| // Create canvas | |
| var cv = document.createElement('canvas'); | |
| var ctx = cv.getContext('2d'); | |
| cv.style.position = 'fixed'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $deck = [ | |
| 'SPA'=>['suite'=>'spade','value'=>'ace', 'char'=>'U+1F0A1'], | |
| 'SP2'=>['suite'=>'spade','value'=>'2', 'char'=>'U+1F0A2'], | |
| 'SP3'=>['suite'=>'spade','value'=>'3', 'char'=>'U+1F0A3'], | |
| 'SP4'=>['suite'=>'spade','value'=>'4', 'char'=>'U+1F0A4'], | |
| 'SP5'=>['suite'=>'spade','value'=>'5', 'char'=>'U+1F0A5'], | |
| 'SP6'=>['suite'=>'spade','value'=>'6', 'char'=>'U+1F0A6'], | |
| 'SP7'=>['suite'=>'spade','value'=>'7', 'char'=>'U+1F0A7'], | |
| 'SP8'=>['suite'=>'spade','value'=>'8', 'char'=>'U+1F0A8'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo Tweaking the linux kernel... | |
| echo disable pmtu discovery | |
| echo /proc/sys/net/ipv4/ip_no_pmtu_disc: | |
| cat /proc/sys/net/ipv4/ip_no_pmtu_disc | |
| echo recommended value is 1 | |
| echo enable workaround when broken window scaling is detected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //@see http://www.woodlandmanufacturing.com/articles/news/how-to-make-a-stranger-things-alphabet-sign-with-lights-code | |
| #include "FastLED.h" | |
| // How many leds in your strip? | |
| #define NUM_LEDS 50 | |
| #define DATA_PIN 5 | |
| #define BRIGHTNESS 255 | |
| // Define the array of leds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Make sure only root can run our script | |
| FILE="/tmp/out.$$" | |
| GREP="/bin/grep" | |
| if [ "$(id -u)" != "0" ]; then | |
| echo "This script must be run as root" 1>&2 | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Updates ip address in the noip DDNS serivce. | |
| # Assumes curl + gnu tools | |
| # Param descriptions taken from API docs. | |
| # http://www.noip.com/integrate/request | |
| #Config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Solution based on https://stackoverflow.com/a/11988455/119829 | |
| # Thank you balanv. | |
| # | |
| base_domain=test.example.com; | |
| command -v telnet >/dev/null 2>&1 || { echo >&2 "I require telnet but it's not installed. Aborting."; exit 1; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $file = __DIR__ . DIRECTORY_SEPARATOR . 'post2log.txt'; | |
| $post = $_POST; | |
| if(!empty($post)){ | |
| $post['timestamp'] = date('r'); | |
| file_put_contents($file,print_r($post,true),FILE_APPEND); | |
| http_response_code(202); | |
| print_r($post); | |
| }else{ | |
| http_response_code(405); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $video = __DIR__ . '/video.mp4'; | |
| $fps = 4; | |
| # Convert an MP4 to a GIF - Requires ffmpeg | |
| `ffmpeg -i "$video" -pix_fmt rgb24 -r $fps "$video.gif"` | |
| # optimize the gif - Requires imagemagick | |
| # via http://superuser.com/questions/436056/how-can-i-get-ffmpeg-to-convert-a-mov-to-a-gif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Extract key and value from all "define" constants in a wp-config.php file using built-in php tokenizer functions. | |
| * Does not "include" the file so it won't pollute the current scope or cause side effects. | |
| * | |
| * NOTE: Works with constants defined as string, bool or number | |
| * Method can extract values from statements like: | |
| * define( 'DB_NAME', 'wordpress' ); | |
| * define('WP_DEBUG', true); | |
| * define('SOMEINT', 1234567); |
NewerOlder