Skip to content

Instantly share code, notes, and snippets.

View evansims's full-sized avatar

Evan Sims evansims

View GitHub Profile
@nerik
nerik / mapbox_gruntfile.js
Last active August 29, 2015 14:02
make a local copy of mapbox assets
grunt.registerTask('mapbox', function() {
var version = this.options().version;
console.log('mapbox v' + version);
var baseUrl = 'https://api.tiles.mapbox.com/mapbox.js/v'+version+'/';
//async task
var done = this.async();
//reset mapbox folder in bower_components
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="/assets/img/favicon/apple-touch-icon-152x152-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/assets/img/favicon/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="/assets/img/favicon/apple-touch-icon-120x120-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/img/favicon/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="/assets/img/favicon/apple-touch-icon-76x76-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/img/favicon/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/assets/img/favicon/apple-touch-icon-precomposed.png">
<link rel="icon" href="/assets/img/favicon/favicon-16x16.png" sizes="16x16">
<link rel="icon" href="/assets/img/favicon/favicon-32x32.png" sizes="32x32">

Install Dnsmasq on OSX

This will allow any url having the non-existant TLD .dev to resolve to your locale machine.

Install dnsmasq and run as a service

$ brew update
@danmactough
danmactough / add-collaborator.sh
Created October 12, 2015 16:04
I needed to add a read-only collaborator to many repositories, and doing it via the website was really tedious
#!/bin/bash
GITHUB_TOKEN=$(git config --global github.token) # I've defined an API token in my git config -- ymmv
GITHUB_USER="" # the collaborator
REPO_OWNER="" # the owner of the repos
REPOS="" # space-delimited list of repositories
PERMISSION="pull" # may be one of "admin", "push" (i.e., read/write -- default), or "pull" (i.e., read-only)
for REPO in ${REPOS} ; do
curl -X PUT -i -d '{ "permission": "'${PERMISSION}'" }' \
-H 'Accept: application/vnd.github.ironman-preview+json' \
-H "Authorization: token ${GITHUB_TOKEN}" \
@ispedals
ispedals / video-thumbnail-display.html
Created May 20, 2013 16:19
Experiment creating thumbnails of MP4 videos using the HTML5 Filereader API. Currently, the loading of videos in rapid succession fails with a decoding error, and if too many videos are processed concurrently, the display driver crashes.
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="https://rawgithub.com/caolan/async/master/lib/async.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<script>
window.URL = window.URL || window.webkitURL;
@NuckChorris
NuckChorris / array.js
Last active February 12, 2018 19:47 — forked from pixelhandler/transforms.js
In Ember-CLI, transforms are located in app/transforms/name.js
// app/transforms/array.js
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Transform.extend({
deserialize: function(value) {
if (Ember.isArray(value)) {
return Ember.A(value);
} else {
return Ember.A();
<?php
const SLACK_TOKEN = '';
const SLACK_CHANNEL = '#worldcup';
const SLACK_BOT_NAME = 'World Cup';
const SLACK_BOT_AVATAR = 'https://i.imgur.com/Pd0cpqE.png';
function curl_get($url) {
$curl = curl_init();
curl_setopt_array($curl, array(
@jameshartig
jameshartig / ioCrawler.go
Last active September 19, 2018 00:23
Google I/O 2014 redeem easter egg crawler
//before running make sure you setup a GOPATH env variable and ran: "go get code.google.com/p/go.net/html"
//to run: go run ioCrawler.go -url="http://developers.google.com/"
//also try http://developer.android.com/index.html
//output goo.gl links to try and redeem will be sent to foundLinks.txt
//by the way there's an artificial "rate limit" in func crawler, you can lower that or raise it as you wish
//You can also comment out the onlyGoogleRegex code if you don't want to limit to google.com/youtube
//if you're getting I/O timeout errors, then you might need to increase the timeouts on line 231
@meanevo
meanevo / haproxy.cfg
Last active July 25, 2019 16:51
H2, HTTP/1.1 traffic balance/routing with HAProxy 1.7 (with SSL-Termination) and Nginx 1.10.2
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
daemon
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 2048
user haproxy
group haproxy
@sr75
sr75 / osx-homebrew-setup.md
Last active June 18, 2020 06:35
Mac Yosemite OSX - Homebrew (RVM/MySQL/Redis) setup

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2