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
try: | |
selenium.find_element_by_css_selector(FUNCTIONS_MODULE_SELECTOR)) | |
except NoSuchElementException: | |
# CODE HERE IF ELEMENT DOES NOT EXIST | |
else: | |
# CODE HERE IF ELEMENT EXISTS |
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
import * as models from "models"; | |
import fs from "fs"; | |
for(let model in models) { | |
let attributes = models[model].attributes; | |
for(let column in attributes) { | |
delete attributes[column].Model; | |
delete attributes[column].fieldName; |
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
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
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 | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
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/bash | |
# View Delimiter | |
DLM='-------------------------------------' | |
# Set Output Colors | |
red=`tput setaf 1` | |
green=`tput setaf 2` | |
blue=`tput setaf 4` | |
cyan=`tput setaf 6` |
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
jQuery.fn.animateAuto = function(prop, speed, callback){ | |
var elem, height, width; | |
return this.each(function(i, el){ | |
el = jQuery(el), elem = el.clone().css({"height":"auto","width":"auto"}).appendTo(el.parent()); | |
height = elem.css("height"), | |
width = elem.css("width"), | |
elem.remove(); | |
if(prop === "height") | |
el.animate({"height":height}, speed, callback); |
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
Started GET "/shoma86" for 127.0.0.1 at 2012-10-04 14:54:01 -0400 | |
Processing by UsersController#show as HTML | |
Parameters: {"id"=>"shoma86"} | |
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."username" = 'shoma86' LIMIT 1 | |
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 53 LIMIT 1 | |
TwitterAccount Load (0.1ms) SELECT "twitter_accounts".* FROM "twitter_accounts" WHERE "twitter_accounts"."user_id" = 53 LIMIT 1 | |
FacebookAccount Load (0.1ms) SELECT "facebook_accounts".* FROM "facebook_accounts" WHERE "facebook_accounts"."user_id" = 53 LIMIT 1 | |
YoutubeAccount Load (0.1ms) SELECT "youtube_accounts".* FROM "youtube_accounts" WHERE "youtube_accounts"."user_id" = 53 LIMIT 1 |