Skip to content

Instantly share code, notes, and snippets.

View prokizzle's full-sized avatar
🌮
IT'S TACO TIME!

Nick Prokesch prokizzle

🌮
IT'S TACO TIME!
View GitHub Profile
@prokizzle
prokizzle / default.conf
Last active March 28, 2023 02:10
Working Nginx Config for Faye over SSL
upstream faye_server {
server 127.0.0.1:9292;
}
server {
# listen 80;
listen 443 ssl;
server_name your-faye-server.com;
@prokizzle
prokizzle / ExampleComponent.js
Last active July 14, 2021 00:55
useFeatureFlag Example
import React from 'react';
import useFeatureFlag from './useFeatureFlag';
import RecommendationsComponent from './Recommendations.js';
const {
DecoratedComponent: Recommendations,
featureEnabled: recommendationsFeatureEnabled,
FeatureFlag
} = useFeatureFlag({
Component: RecommendationsComponent,
@prokizzle
prokizzle / webpack.config.js
Last active May 9, 2020 05:10
Feature Flags
const { filter, test, keys, fromPairs, map, match } = require('ramda');
const env = dotenv.config({ path: ".env.local" }).parsed;
const featureKeys = filter(test(/^FEATURE/), keys(env));
const FeatureFlags = fromPairs(map(key => [match(/FEATURE_([\w\W]+)/, key)[1], env[key]], featureKeys));
module.exports = {plugins: [new webpack.DefinePlugin({ ...env, FeatureFlags })]};
@prokizzle
prokizzle / CodeEvalBox.js
Last active July 31, 2018 00:30
Adds a textarea to the top of the page that can execute javascript within the page. Useful for testing code on mobile browsers.
var codeEval = document.createElement('div');
var inputBox = document.createElement('textarea', { rows: 200, cols: 800 });
var evalButton = document.createElement('button');
var buttonText = document.createTextNode('Eval');
evalButton.appendChild(buttonText);
codeEval.appendChild(inputBox);
codeEval.appendChild(evalButton);
document.body.insertBefore(codeEval, document.body.firstElementChild);
evalButton.addEventListener('click', function () { eval(inputBox.value)});
#!/bin/bash
# (optional) You might need to set your PATH variable at the top here
# depending on how you run this script
#PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="enter zone id here"
# The CNAME you want to update e.g. hello.example.com
@prokizzle
prokizzle / authenticated_scraper.rb
Created October 24, 2014 16:09
Serialize authenticated Mechanize sessions in Ruby
class AuthenticatedScraper
def initialize(args)
if args[:session]
@cookie_jar = args[:session]
@agent = Mechanize.new
@agent.cookie_jar = load_session(@cookie_jar)
else
@agent = Mechanize.new
@agent.login(args[:username], args[ password])
end
@prokizzle
prokizzle / itunes-toggle-up-next.scpt
Created November 30, 2012 19:36
Toggle iTunes Up Next - LaunchBar Action
tell application "iTunes" to activate
try
menu_click({"iTunes", "View", "Show Up Next"})
on error
menu_click({"iTunes", "View", "Hide Up Next"})
end try
-- `menu_click`, by Jacob Rus, September 2006
--
-- Accepts a list of form: `{"Finder", "View", "Arrange By", "Date"}`
-- Execute the specified menu item. In this case, assuming the Finder
@prokizzle
prokizzle / custom.paths.zsh
Created September 7, 2015 22:24
Oh-My-Zsh custom paths
paths=(
"/Applications/Postgres93.app/Contents/MacOS/bin"
"$PATH:$GOPATH/bin"
"/usr/local/bin"
"/usr/local/opt"
"/usr/local"
"/opt/chefdk/bin"
"$HOME/.node/bin"
"$NPM_PACKAGES/bin"
"/usr/local/sbin"
@prokizzle
prokizzle / inject.js
Created September 7, 2015 22:00
Javascript External CSS Injector
var Inject = {
externalCSS: function(href) {
var css = document.createElement('link');
css.href = href;
css.type = 'text/css';
css.rel = 'stylesheet';
var head = document.getElementsByTagName('head')[0];
head.appendChild(css);
},
fontAwesome: function(){
@prokizzle
prokizzle / .default-gems
Created September 4, 2015 20:20
Chruby Default Gems Installer
# Chruby Default Gem Installer
# Install gems for all installed versions of ruby
# by Nick Prokesch
source /usr/local/share/chruby/chruby.sh
gems=(
bundler
homesick
mechanize