Skip to content

Instantly share code, notes, and snippets.

View defenestrator's full-sized avatar

Jeremy Jacob Anderson defenestrator

  • I'm great company.
  • Boise, ID
  • 02:24 (UTC -06:00)
View GitHub Profile
#!/bin/sh
sudo yum install -y gcc
wget http://download.redis.io/releases/redis-2.8.17.tar.gz
tar xzf redis-2.8.17.tar.gz
cd redis-2.8.17
make
sudo cp ./src/redis-server /usr/local/bin/
sudo cp ./src/redis-cli /usr/local/bin/
@defenestrator
defenestrator / gist:5d5d3fd729b58cc87288
Last active August 29, 2015 14:20
hiddenFilesOsxToggle.sh
#!/bin/bash
STATUS=`defaults read com.apple.finder AppleShowAllFiles`
if [ $STATUS == YES ];
then
defaults write com.apple.finder AppleShowAllFiles NO
else
defaults write com.apple.finder AppleShowAllFiles YES
fi
killall -TERM Finder
@defenestrator
defenestrator / Country.php
Created August 8, 2015 14:10
PHP Countries Utitility Class
<?php
namespace App\Http\Utilities;
class Country {
protected static $countries = [
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
@defenestrator
defenestrator / _social-colors-2014.scss
Created September 27, 2015 00:07 — forked from math-is-hard/_social-colors-2014.scss
Social Network Colors (2014)
/* Social
======================================================================================= */
$col-addthis : #fe6d4c;
$col-blogger : #fb8f3d;
$col-dribbble : #ea4c89;
$col-facebook : #3b5998;
$col-flickr : #ff0084;
$col-forrst : #5B9A68;
$col-foursquare : #0072b1;
$col-googleplus : #dd4b39;
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@defenestrator
defenestrator / state-abbr.js
Created October 28, 2016 17:45
Two-way State/Abbreviation Transformer
function convert_state(name, to) {
var name = name.toUpperCase();
var states = new Array( {'name':'Alabama', 'abbrev':'AL'}, {'name':'Alaska', 'abbrev':'AK'},
{'name':'Arizona', 'abbrev':'AZ'}, {'name':'Arkansas', 'abbrev':'AR'}, {'name':'California', 'abbrev':'CA'},
{'name':'Colorado', 'abbrev':'CO'}, {'name':'Connecticut', 'abbrev':'CT'}, {'name':'Delaware', 'abbrev':'DE'},
{'name':'Florida', 'abbrev':'FL'}, {'name':'Georgia', 'abbrev':'GA'}, {'name':'Hawaii', 'abbrev':'HI'},
{'name':'Idaho', 'abbrev':'ID'}, {'name':'Illinois', 'abbrev':'IL'}, {'name':'Indiana', 'abbrev':'IN'},
{'name':'Iowa', 'abbrev':'IA'}, {'name':'Kansas', 'abbrev':'KS'}, {'name':'Kentucky', 'abbrev':'KY'},
{'name':'Louisiana', 'abbrev':'LA'}, {'name':'Maine', 'abbrev':'ME'}, {'name':'Maryland', 'abbrev':'MD'},
{'name':'Massachusetts',
<?php
/*
//Normal query
User::all();
//Cached query (default 60min)
User::cached()->all();
//Cached query (5min)
@defenestrator
defenestrator / pure_html_css_modal.css
Created May 8, 2019 18:21 — forked from calebporzio/pure_html_css_modal.css
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
@defenestrator
defenestrator / package.json
Last active June 30, 2022 13:52
Laravel Tailwind and Svelte 3: simple configuration.
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
@defenestrator
defenestrator / awesome_favorite_fizzbuzz.js
Last active May 17, 2022 04:45
Some Fizzbuzz for meditation
// This one is interesting because no previously checked condition is re-checked
// It is a self-executing function that contains a declarative function named fizzbuzz() and a for loop
// Too much fun
(function() {
function fizzbuzz(i) {
const test = (d, s, x) => i % d == 0 ? _ => s + x('') : x
const fizz = x => test(3, 'Fizz', x)
const buzz = x => test(5, 'Buzz', x)
console.log(fizz(buzz(x=>x))(i.toString()))
}