Skip to content

Instantly share code, notes, and snippets.

View chrisjlee's full-sized avatar
💭
🏈

Chris J. Lee chrisjlee

💭
🏈
View GitHub Profile
@chrisjlee
chrisjlee / app.js
Created December 19, 2013 19:37
Creating the simple static file server using node.js and express
var express = require('express'),
htmlDir = './html/'
var app = express();
//Log all requests
app.use(express.logger());
//Set content directories
app.use(express.static(__dirname + '/html'));
app.use('/js',express.static(__dirname + '/js'));
@chrisjlee
chrisjlee / delete-feature-branches.sh
Last active March 30, 2022 21:51
Delete feature branch with prefix locally then remove all remote feature branches
# Stole from:
# http://stackoverflow.com/questions/32122784/alias-script-to-delete-all-local-and-remote-git-branches-with-a-specific-prefix
git branch -D $(printf "%s\n" $(git branch) | grep 'feature/')
# Or this will work too to remove all remote branches:
# https://coderwall.com/p/eis0ba/remove-a-thousand-stale-remote-branches-on-git
git branch -r | awk -F/ '/\/feature/{print $2}' | xargs -I {} git push origin :{}
# Prune all origin branches
git remote prune origin
@chrisjlee
chrisjlee / googlemaps.apxc
Last active March 22, 2022 09:25
Salesforce and Google Maps API to calculate distance borrowed from: http://bulkified.com/How+to+use+the+Google+Maps+API+in+Salesforce.com
public class googleMaps {
public String duration {get;set;}
public Integer travelTime {get;set;}
public Decimal distance {get;set;}
public googleMaps(
String address1,
String address2) {
var gulp = require('gulp');
var connect = require('gulp-connect');
var cors = function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Headers', '*');
next();
};
gulp.task('server:test', function () {
@chrisjlee
chrisjlee / wp.sh
Created August 6, 2012 21:24 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script
#!/bin/bash
echo “Database Name: ”
read -e dbname
echo “Database User: ”
read -e dbuser
echo “Database Password: ”
read -s dbpass
echo “run install? (y/n)”
read -e run
if [ "$run" == n ] ; then
@chrisjlee
chrisjlee / gist:9299678
Created March 2, 2014 00:07
Translatez - translate z hack forces the browser to create a new layer and send rendering to the GPU. Helpful for items that move or animate. Source: http://stackoverflow.com/questions/10814178/css-performance-relative-to-translatez0
-webkit-transform: translatez(0);
-moz-transform: translatez(0);
-ms-transform: translatez(0);
-o-transform: translatez(0);
transform: translatez(0);
@chrisjlee
chrisjlee / fix-permissions.sh
Created May 17, 2012 16:15
Permissions script for drupal - fixes the permissions of any drupal install automatically!
#!/bin/bash
# From: http://drupal.org/node/244924
path=${1%/}
user=${2}
group="www-data"
help="\nHelp: This script is used to fix permissions of a drupal installation\nyou need to provide the following arguments:\n\t 1) Path to your drupal installation\n\t 2) Username of the user that you want to give files/directories ownership\nNote: \"www-data\" (apache default) is assumed as the group the server is belonging to, if this is different you need to modify it manually by editing this script\n\nUsage: (sudo) bash ${0##*/} drupal_path user_name\n"
if [ -z "${path}" ] || [ ! -d "${path}/sites" ] || [ ! -f "${path}/modules/system/system.module" ]; then
echo "Please provide a valid drupal path"
echo -e $help
@chrisjlee
chrisjlee / drushrc.php
Created March 28, 2012 20:38
drushrc.php - preferred drushrc.php file
<?php
/**
* Examples of valid statements for a Drush runtime config (drushrc) file.
* Use this file to cut down on typing out lenghty and repetetive command line
* options in the Drush commands you use and to avoid mistakes.
*
* Rename this file to drushrc.php and optionally copy it to one of the places
* listed below in order of precedence:
*
@chrisjlee
chrisjlee / delete-feature.sh
Created March 30, 2016 22:26
Delete branch with prefix
git branch -D `git branch | grep 'feature/*'`
@chrisjlee
chrisjlee / app.scss
Created August 28, 2017 15:10
fix the bootstrap / webpack asset import issue
// https://github.com/webpack-contrib/sass-loader/issues/40
$bootstrap-sass-asset-helper: true;
@import "~bootstrap-sass/assets/stylesheets/bootstrap";