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
ssh-copy-id 'user@remotehost' # Automatically installs your public key to the remote host (this is included in the openssh package) |
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
// Redirect users who arent logged in... | |
function login_redirect() { | |
// Current Page | |
global $pagenow; | |
// Check to see if user in not logged in and not on the login page | |
if(!is_user_logged_in() && $pagenow != 'wp-login.php') | |
// If user is, Redirect to Login form. | |
auth_redirect(); |
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
--- <yourproject.js> --- | |
SubscriptionOne = new Meteor.Collection('subscription1'); | |
SubscriptionTwo = new Meteor.Collection('subscription2'); | |
if(Meteor.isClient) { | |
// iron:router route | |
Router.route('/', { | |
onBeforeAction:function() { | |
// .. any onBeforeAction |
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
def is_number(s): | |
"""Test if the passed string contains a number @ position 0""" | |
try: | |
float(s) | |
return True | |
except ValueError: | |
return False |
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
def hash(s): | |
"""returns an MD5 hash of the passed string s | |
We have to encode the passed string as ascii """ | |
hash = '' | |
if s is not None: | |
hash = hashlib.md5(s.encode('ascii', 'ignore')).hexdigest() | |
return hash |
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
def read_file(file_name): | |
"""reads a file in to memory, | |
first checking the user has access rights to the file""" | |
try: | |
fp = open(file_name, 'r') | |
except IOError as e: | |
if e.errno == errno.EACCES: | |
return False | |
raise | |
else: |
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
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock -t jwilder/nginx-proxy |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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
echo "php_flag display_errors 1" > .htaccess |
OlderNewer