This file contains 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
#!/usr/bin/env bash | |
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`. | |
# Please modify the CONSTANT variables to fit your configurations. | |
# The script will start with config set by $PUMA_CONFIG_FILE by default | |
PUMA_CONFIG_FILE=config/puma.rb | |
PUMA_PID_FILE=tmp/pids/puma.pid | |
PUMA_SOCKET=tmp/sockets/puma.sock |
This file contains 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/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
This file contains 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 | |
// Code snippet to extract the icon from an exe file on a Linux system -- tested on Debian Wheezy | |
// Install icoutils on your system e.g. sudo apt-get install icoutils | |
// Web process must have write privileges to /tmp | |
///** Config **/// | |
$input_file = '/path/to/program.exe'; |
This file contains 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
$('form').validate( | |
{ | |
rules: { | |
numero: { | |
required: true | |
}, | |
descricao: { | |
minlength: 3, | |
email: true, | |
required: true |
This file contains 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
#!/opt/local/bin/php | |
<?php | |
/* | |
1) replace the shebang (first line) with the path to your php binary | |
(probably something like /usr/bin/php) | |
2) move the file to /usr/local/bin/datauri.php | |
(this should be in your PATH) | |
3) chmod ugo+rx /usr/local/bin/datauri.php | |
(make the script executable for everyone) |
This file contains 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
# update our entry with our ip | |
wget -qO- https://api.linode.com/?api_key=KEY\&api_action=domain.resource.update\&domainid=DOMAINID\&resourceid=RESOURCEID\&Target="[remote_addr]" | |
# | |
# in case you don't have your Domain ID on hand, you would need to run the following command first: | |
# wget -qO- https://api.linode.com/?api_key=APIKEY\&api_action=domain.list | tr ',' '\n'``` | |
# | |
# afterwards, we can get the ResourceID via: | |
# wget -qO- https://api.linode.com/?api_key=APIKEY\&api_action=domain.resource.list\&domainid=DOMAINID| tr ',' '\n'``` | |
# |