Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

var removeURLParam = function (url, parameter) {
var fragment = url.split('#'),
urlparts= fragment[0].split('?'),
urlBase = '',
queryString = '',
prefix = '',
pars = null,
i = 0;
if (urlparts.length>=2)
sudo xcodebuild -license
xcode-select --install # There will be a GUI prompt
sudo cpan SVN::Core # use the "sudo" method when prompted
# Then add this to your ~/.profile:
# export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH
# Then probably:
brew reinstall git
brew reinstall subversion
@patricksimpson
patricksimpson / gist:8457610
Created January 16, 2014 16:09
Rewrite Rule
RewriteRule ^/test /test?var=val [QSA]
@patricksimpson
patricksimpson / deploy.sh
Created October 2, 2013 14:18
Lightweight github deployment. Requires (Expect) on your client box. You must setup the remote server first, by creating the remote path, and setting up a github clone of your repository. You can either setup an install script on the server, or run your install commands from this file.
#!/usr/bin/expect
set password "thepassword"
set login "yourlogin"
set host "199.199.199.199"
set remotepath "/var/www/html/yoursite.com"
spawn ssh $host -l $login
expect "$login@$host's password: "
send "$password\n"
@patricksimpson
patricksimpson / scripts.coffee
Last active December 23, 2015 23:28
The CoffeeScript example source code.
# Assignment:
number = 42
opposite = true
# Conditions:
number = -42 if opposite
# Functions:
square = (x) -> x * x
var App;
function App() {
this.panda = "sad";
}
module.exports = App;
var AppClient = function() {
this.name = "Panda";
};
AppClient.prototype.setName = function(name) {
this.name = name;
};
AppClient.prototype.getName = function() {
return this.name;
{
"name": "MochaJasmine",
"description": "Mocha and Jasmine Testing",
"version": "0.0.1",
"devDependencies": {
"grunt": "0.4.x",
"grunt-contrib-watch": "~0.2.0",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-jasmine": "~0.4.2",
"grunt-mocha-cli": "~1.0.2",
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
watch: {
grunt: {
files: ["Gruntfile.js", "package.json"],
tasks: "default"
},
javascript: {
files: ["src/client/**/*.js", "src/server/*.js", "specs/**/*Spec.js"],
@patricksimpson
patricksimpson / git-tfs-pull
Created December 7, 2012 20:59
git tfs pull
#!/usr/bin/expect
set username "your.name"
set password "yoursupercoolpassword"
spawn git tf pull
expect "Username:";
send "$username\n";
expect "Password:";
send "$password\n";
interact