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
/** | |
* This function analyses every DOM element | |
* that uses rules specified in the css stylesheet | |
* in the current document matching `cssFilename` | |
* | |
* @author Campbell Morgan, 2017 | |
* @example | |
* | |
* // 1. either load this code with the document or paste it into Chrome Dev Tools | |
* // 2. Instantiate the analyser |
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
// ==UserScript== | |
// @name Facebook Politics Filter | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove As Many politics posts as possible from your facebook feed | |
// @author Campbell Morgan @camsmorgan | |
// @match https://www.facebook.com/ | |
// @grant none | |
// ==/UserScript== |
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 | |
# Changes all spaces to tabs in a javscript project | |
# run at project root | |
files=`find . -path ./node_modules -prune -o -name "*.js"` | |
for file in $files; do | |
echo "Processing $file" | |
cat "$file" | unexpand -t 2 > "$file.new" | |
rm -f "$file" |
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
// drop this file into maya where your | |
// fully rigged (by AdvancedSkeleton 5.1 +) model is open | |
// disable effect of faceupper and facelower fk | |
// keep elements so that "go to build pose" doesn't break | |
delete FaceUpper_M_parentConstraint1; | |
delete FaceUpper_M_scaleConstraint1; | |
delete FaceLower_M_parentConstraint1; | |
delete FaceLower_M_scaleConstraint1; |
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
/** | |
* Module for abstracting pub sub | |
* across all scopes | |
* @example | |
* | |
* var events = PubSub($scope, 'MyModule:'); | |
* events.on('AnotherModule:Update', function(e, data) { | |
* console.log(data, 'from Update'); | |
* }); | |
* events.emit("Change", {myData:'data'}); |
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 | |
####### | |
# Enables branch-specific sitechef config files | |
# my moving data.json and .sitechef/.conf to subdirectories | |
# named after the branch name | |
# | |
# Installation | |
# Copy this file to your .git/hooks/ folder | |
###### |
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
var Waterline, count, memory, _; | |
_ = require('lodash'); | |
// sails-memory stores the adapter as a | |
// variable and it needs a different version for each instance | |
count = 0; | |
Waterline = require('waterline'); |
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
/** | |
* This goes in the api/hooks folder | |
* and uses the so-far unstable sails events | |
* works in sails 0.10.x | |
*/ | |
var generator = require('password-generator'); | |
module.exports = function(sails) { | |
return { |
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 | |
# shutdownscript - a template for a script that will run on shutdown | |
# chkconfig 2345 99 01 | |
# write the name of the file (which will be the daemon here) | |
scriptname="shutdownscript" | |
# installation instructions: | |
# - save this script in /etc/init.d/[yourscriptname] | |
# - chown root:root [yourscriptname] |