Skip to content

Instantly share code, notes, and snippets.

View jeffsaracco's full-sized avatar

Jeff Saracco jeffsaracco

View GitHub Profile
@jeffsaracco
jeffsaracco / bagel-recipe.md
Last active April 27, 2020 16:50
Bagel recipe

Basic Bagels

CCF9ECF0-D7FE-46BF-9BBB-EEC89C7A7284_1_105_c

Ingredients

  • 2 teaspoon dry yeast
  • 0.5 teaspoon sugar
  • 1.5 cups lukewarm water
  • 4 cups bread flour
@jeffsaracco
jeffsaracco / donut-recipe.md
Last active April 20, 2020 12:48
donut-recipe

Donut Recipe

2440BFBF-6159-4673-8584-45396C7ECB8E_1_105_c

Ingredients

Dough

  • 1 cup milk
  • 1/4 cup plus 1 tsp. granulated sugar, divided
@jeffsaracco
jeffsaracco / docker.sh
Created July 10, 2018 17:50
Docker for mac IO perf improvement
#!/bin/bash
cd ~/Library/Containers/com.docker.docker/Data/database/
mkdir -p ./com.docker.driver.amd64-linux/disk
echo -n false > ./com.docker.driver.amd64-linux/disk/full-sync-on-flush
echo -n none > ./com.docker.driver.amd64-linux/disk/on-flush
@jeffsaracco
jeffsaracco / raspberry-pi-vpn-router.md
Last active August 12, 2016 18:47 — forked from superjamie/raspberry-pi-vpn-router.md
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2015-09-24-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'
headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'
headers['Access-Control-Max-Age'] = "1728000"
end
@jeffsaracco
jeffsaracco / Q-promises-synch-tests.md
Last active August 29, 2015 14:21
Sinon synchronous tests with Q promises

The code below will effectively turn your Asynchronous Q promises synchronous so that they are easier to test.

  beforeEach(function () {
    sinon.stub(Q.xhr, 'post').returns(Q.resolve({myAwesome: 'response data goes here'}));
    sinon.stub(process, 'nextTick').yields();
  });

  afterEach(function () {
 Q.xhr.post.restore();
echo "* Updating system"
apt-get update
apt-get -y upgrade
echo "* Installing packages"
apt-get -y install build-essential libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core nginx redis-server curl nodejs htop
id -u deploy &> /dev/null
if [ $? -ne 0 ]
then
@jeffsaracco
jeffsaracco / gist:cb36297b7543021fbf2a
Created September 26, 2014 13:38
Reformat JSON in vim
:%!python -m json.tool
// helper to create proper asset paths if an asset host is configured
App.assets = {
assets : {
<% AssetsUtil.images.each do |img| %>
"<%= img %>" : "<%= asset_path(img) %>",
<% end %>
},
@jeffsaracco
jeffsaracco / boxen errors
Last active August 29, 2015 14:01
Errors from initial
Jeffs-MacBook-Pro-2:~ jeff$ curl -s https://intridea-boxen-web.herokuapp.com/script/590343f6.sh > /tmp/install-boxen; bash /tmp/install-boxen
Since you are running OS X 10.9, you will need to install the Command
Line Tools (even if you already have Xcode installed).
1. You should see a pop-up asking you to install them in a moment.
2. Click Install!
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)