Skip to content

Instantly share code, notes, and snippets.

View MagneticMule's full-sized avatar
🏠
Working from home

Thomas D. Sweeney MagneticMule

🏠
Working from home
  • Seventh Stage
  • Nottingham
View GitHub Profile
def is_number(s):
"""Test if the passed string contains a number @ position 0"""
try:
float(s)
return True
except ValueError:
return False
@MagneticMule
MagneticMule / ironrouter-waiton.js
Created November 5, 2015 17:37 — forked from herrhelms/ironrouter-waiton.js
how to wait on multiple subscriptions with iron:router and make it available as data in your template...
--- <yourproject.js> ---
SubscriptionOne = new Meteor.Collection('subscription1');
SubscriptionTwo = new Meteor.Collection('subscription2');
if(Meteor.isClient) {
// iron:router route
Router.route('/', {
onBeforeAction:function() {
// .. any onBeforeAction
@MagneticMule
MagneticMule / login_redirect.php
Last active August 29, 2015 14:28
Redirect to login in Wordpress
// 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();
@MagneticMule
MagneticMule / ssh-copy+id
Created March 23, 2015 22:47
Copy sah key to remote host
ssh-copy-id 'user@remotehost' # Automatically installs your public key to the remote host (this is included in the openssh package)