Skip to content

Instantly share code, notes, and snippets.

View EvilScott's full-sized avatar

Molly Reis EvilScott

View GitHub Profile
@rrosiek
rrosiek / install_mysql.sh
Last active June 5, 2023 07:08
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Tested with Ubuntu 16.04.
#! /usr/bin/env bash
###
#
# install_mysql.sh
#
# This script assumes your Vagrantfile has been configured to map the root of
# your application to /vagrant and that your web root is the "public" folder
# (Laravel standard). Standard and error output is sent to
# /vagrant/vm_build.log during provisioning.
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@oloynet
oloynet / resourcetiming.js
Created February 8, 2013 16:20
Catch all the resource load times with casperjs
var casper = require("casper").create({
//loadImages: false,
//logLevel: 'debug',
verbose: true
});
var utils = require('utils');
/* ----- test parameters ----- */
@actsasgeek
actsasgeek / line.rb
Created July 20, 2012 21:11
ruby implementation of gradient descent linear regression
require 'generator'
samples = [
{ :xs => [ 1.0, 0.25], :y => 0.98},
{ :xs => [ 1.0, 0.49], :y => 0.82},
{ :xs => [ 1.0, 0.60], :y => 0.41},
{ :xs => [ 1.0, 0.89], :y => 0.31}
]
# line is the sum of the dot product of the weight (thetas)
@jimbojsb
jimbojsb / gist:1665345
Created January 23, 2012 20:20
Delete resolved jira ticket branches
#!/bin/bash
for i in $(git branch | grep "OFR-"); do
xml="`wget -qO- http://jira.office.vertive.com/si/jira.issueviews:issue-xml/$i/$i.xml`"
closed=`echo $xml | grep ">Closed</status"`
strlen=${#closed}
if [ ! $strlen == "0" ]
then
echo "Deleting $i"
git branch -D $i
fi
@daveray
daveray / seesaw-repl-tutorial.clj
Created December 7, 2011 04:55
Seesaw REPL Tutorial
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
@ocean90
ocean90 / box-shadow.html
Last active April 11, 2024 13:54
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@chriskite
chriskite / Git Bash Prompt
Created April 9, 2010 15:45
Git Customization
PS1='\u@\h:\w\[\033[32m\]$(__git_ps1)\[\033[0m\]$ '
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby