Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| #!/bin/bash | |
| set -e | |
| usage(){ | |
| echo "Error $errcode $errorcode at line ${BASH_LINENO[0]} while executing: $BASH_COMMAND" | |
| exit $errorcode | |
| } | |
| trap usage ERR |
Thanks to Jacob Kaplan-Moss, Donald Stufft, David Reid, Allen Short, Zain Memon, and Chris Armstrong for review.
This is a guide for technical individuals to understand in what circumstances SSL communications are secure against an observer-in-the-middle (for all intents and purposes: the NSA).
| node -e 'process.stdin.pipe(require("fs").createWriteStream(process.argv[1]))' FILENAME |
| // Grab the EventEmitter constructor. events is a core node module. | |
| var Emitter = require('events').EventEmitter; | |
| // Our internal function will generate random numbers | |
| function randomInt(limit) { | |
| return Math.ceil( Math.random() * limit ); | |
| } | |
| module.exports = function(limit) { | |
| if(!(limit && limit > 0)) { |
| function inherit (child, parent) { | |
| function proxy () {}; | |
| proxy.prototype = parent.prototype; | |
| child.prototype = new proxy(); | |
| }; | |
| function Parent () {} | |
| function Child () {} | |
| inherit(Child, Parent); |
Every time I start a new project, I want to pull in a log function that allows the same functionality as the console.log, including the full functionality of the Console API.
There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.
This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:
| gifify() { | |
| if [[ -n "$1" ]]; then | |
| if [[ $2 == '--good' ]]; then | |
| ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
| time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
| rm out-static*.png | |
| else | |
| ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
| fi | |
| else |
| #!/bin/bash | |
| EMAIL="[email protected]" | |
| API_TOKEN="API_TOKEN" | |
| DOMAIN_ID="your_domain.com" | |
| RECORDS=(123456 234567 345678) # Replace with the Record ID | |
| IP="`curl -s -S http://v4.ident.me`" | |
| STORED_IP_ADDRESS_FILENAME="$HOME/.current_external_ip_address" | |
| # Loop through each record id in the array |