Skip to content

Instantly share code, notes, and snippets.

@fastmover
fastmover / lithium-install.bat
Created June 18, 2012 20:15
Batch File to quickly install lithium framework / lithium / and li3_users
:START
@echo off
SET /P Dir= Enter Name of Directory to Install Lithium Framework to
echo .
echo Installing Lithium Framework to ./%Dir%
START git clone https://github.com/UnionOfRAD/framework.git ./%Dir%
:WAITCLONE
SLEEP 1
@fastmover
fastmover / install-li3_users.py
Created June 26, 2012 03:40
Install li3_users into libraries.php and add new connection to connections.php
import fileinput
import sys, os
def addBefore(file,searchExp,inputExp):
if(os.path.isfile(file)):
for line in fileinput.input(file, inplace=1):
if searchExp in line:
sys.stdout.write(inputExp)
#line = line.replace(searchExp,replaceExp)
sys.stdout.write(line)
#!/bin/bash
# Download Drush v3 from D.O and make it work on `drush` (OS X / Linux / *nix)
# Written by stemount, adapted by KarenS
# Last updated by Drupalise IT (http://drupalise.it) on 13 Sep 2010
# Update user
echo "Drush is now downloading via HTTP"
# move to home dir
@fastmover
fastmover / countCSSRules.js
Last active October 12, 2015 00:08 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '',
totalCount = 0,
totalRules = 0,
fileCount = 0;
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
@fastmover
fastmover / media_youtube.js
Created January 9, 2013 18:41
drupal 7 - media - media_youtube module - media_youtube.js
/**
* @file media_youtube/js/media_youtube.js
*/
(function ($) {
Drupal.media_youtube = {};
Drupal.behaviors.media_youtube = {
attach: function (context, settings) {
@fastmover
fastmover / media_youtube.theme.inc
Created January 9, 2013 20:18
media_youtube.theme.inc
<?php
/**
* @file media_youtube/includes/themes/media_youtube.theme.inc
*
* Theme and preprocess functions for Media: YouTube.
*/
/**
* Preprocess function for theme('media_youtube_video').
@fastmover
fastmover / gist:4591580
Last active December 11, 2015 11:08
Javascript card deck
suits = {
"Clubs" : {
id: "clubs",
name: "Clubs",
unicode: "&clubs;"
},
"Spades": {
id: "spades",
name: "Spades",
unicode: "&spades;"
@fastmover
fastmover / fibonacci-numbers-fn.js
Created January 25, 2013 23:25
Fibonacci Numbers (first 100)
fn = function() {
x = 0
y = 1
prev = 1;
for(z = 0; z < 100; z++)
{
prev = x;
x = y;
y = prev + x;
console.log(y);
@fastmover
fastmover / US_States_Abbrev.txt
Created March 28, 2013 17:31
2 Letter abbreviation of every US state, plus territories, commonwealths, associated states and international military state codes.
AL
AK
AZ
AR
CA
CO
CT
DE
DC
FL
@fastmover
fastmover / tampermonkey.jquery.js
Last active January 18, 2016 23:06 — forked from eristoddle/tampermonkey.jquery.js
Open all links on a page in new windows.
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}