Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
#!/usr/bin/osascript | |
on run | |
if not (application "Mail" is running and application "The Hit List" is running) then | |
return | |
end if | |
tell application "Mail" | |
repeat with _account in imap accounts | |
set _inbox to _account's mailbox "INBOX" | |
set _messages to (a reference to (every message of _inbox whose flagged status is true)) | |
-- We must use this workaround, because the reference will self-update once we unflag a message, and that will get us just one of two flagged messages imported |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#################################################################################### | |
## ## | |
## gittyup() - Easily keep master in sync with upstream. ## | |
## ## | |
## Author: Evan Coury, http://blog.evan.pro/ ## | |
## URL: https://gist.github.com/1506822 ## | |
## ## | |
## This bash function is a simple shortcut for keeping your local (and public ## | |
## fork / origin remote) master branch up to date and in sync with the upstream ## | |
## master. To use gittyup(), simply drop this in your ~/.bashrc. ## |
$constants = get_defined_constants(); | |
array_walk(array_keys($constants), function($key) use (&$constants) { | |
if ('T_' != substr($key, 0, 2)) { | |
unset($constants[$key]); | |
} | |
}); | |
var_export($constants); |
#!/usr/bin/perl | |
use Crypt::Eksblowfish::Bcrypt; | |
use Crypt::Random; | |
$password = 'bigtest'; | |
$encrypted = encrypt_password($password); | |
print "$password is encrypted as $encrypted\n"; | |
print "Yes the password is $password\n" if check_password($password, $encrypted); | |
print "No the password is not smalltest\n" if !check_password('smalltest', $encrypted); |