Skip to content

Instantly share code, notes, and snippets.

View akrabat's full-sized avatar

Rob Allen akrabat

View GitHub Profile
@gcrawshaw
gcrawshaw / gist:1071698
Created July 8, 2011 12:12
Using bcrypt to secure passwords in a Perl application
#!/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);
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
$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);
@EvanDotPro
EvanDotPro / gittyup.sh
Created December 21, 2011 17:15
Easily keep master in sync with upstream.
####################################################################################
## ##
## 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. ##
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@dzuelke
dzuelke / flagged_mails_to_thl.applescript
Created January 29, 2012 22:46
AppleScript to import flagged messages from Mail into The Hit List
#!/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
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/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
#
@jessedearing
jessedearing / gist:2351836
Created April 10, 2012 14:44 — forked from twoism-dev/gist:1183437
Create self-signed SSL certificate for Nginx
#!/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
@alper
alper / import-tweets.txt
Created April 18, 2012 16:25
Thinkup Tweet importetr
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
// Generated on: 2012-04-13 23:44:46 GMT+00:00
// ************** Tweet 1 of 47455 **************
{
"in_reply_to_screen_name": null,
@bubenkoff
bubenkoff / checkpoint.sh
Last active February 14, 2024 21:38
Endpoint Security VPN FULL start/stop script for Mac OS X
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
#
# Usage: ./checkpoint.sh
#
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script.