Skip to content

Instantly share code, notes, and snippets.

View ejdyksen's full-sized avatar
😎

E.J. Dyksen ejdyksen

😎
View GitHub Profile
@ejdyksen
ejdyksen / fix_encoding.rb
Created February 15, 2012 10:32
Fix database encoding
require 'mysql2'
SIMULATE = true
DB_HOST = "localhost"
DB_NAME = "database"
DB_USER = "root"
DB_PASS = "password"
@client = Mysql2::Client.new(
:host => DB_HOST,
@ejdyksen
ejdyksen / gist:3992375
Created November 1, 2012 07:57
Allow node to use privileged ports
sudo apt-get install libcap2-bin
sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node
#
# The goal of this exercise is work on identifying abstraction which helps simplify, document,
# and separate the concerns going on in file.
#
# Exercise:
# * Find related ideas in the below code
# * Abstract them out (methods, modules, classes, etc, you pick!)
# * If you find multiple ways, then do a separate gist for each way.
# * Rinse repeat until you see no other ways.
#
@ejdyksen
ejdyksen / samlfromios.xml
Last active December 14, 2015 15:58
SAML sample
<samlp:AuthnRequest AssertionConsumerServiceURL="http://ruby-saml-example.herokuapp.com/saml/consume"
Destination="https://ec2-54-235-224-165.compute-1.amazonaws.com:9443/samlsso"
ID="_2D729750-3EB6-43A4-8416-938C7114D8C6"
IssueInstant="2013-03-12T16:25:08"
Version="2.0"
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
ruby-saml-example.herokuapp.com
</saml:Issuer>
</samlp:AuthnRequest>
@ejdyksen
ejdyksen / gist:5249180
Created March 26, 2013 20:57
Palette error
2013-03-26 16:54:12.678 palette[655:907] iCloud is available
2013-03-26 16:54:12.795 palette[655:1103] Creating iCloud store
2013-03-26 16:54:12.936 palette[655:907] iCloud is available
2013-03-26 16:54:13.311 palette[655:1103] Persistent store is ready
2013-03-26 16:54:13.313 palette[655:1103] notification: NSConcreteNotification 0x1fd55ca0 {name = NSPersistentStoreCoordinatorStoresDidChangeNotification; object = <NSPersistentStoreCoordinator: 0x1fdc1870>; userInfo = {
added = (
"<NSSQLCore: 0x208af020> (URL: file://localhost/private/var/mobile/Library/Mobile%20Documents/3488MV35N5~com~mutuallyhuman~palette/data.nosync/v62/CB1BD919-3E96-4D3E-B6DE-5270D7F5AE1C/palette.sqlite)"
);
}}
2013-03-26 16:54:13.315 palette[655:1103] ==========UI READY===========
❯ lineman run
Running "configure" task
Running "common" task
Running "coffee:compile" (coffee) task
File generated/js/app.coffee.js created.
File generated/js/spec.coffee.js created.
>> Destination not written because compiled files were empty.
@ejdyksen
ejdyksen / gist:5513145
Created May 3, 2013 19:27
Auto-increment build numbers in Xcode
# Get the path to the already-built info.plist
buildPlist="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
# Construct our version string (in this case, date+git commit)
date=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
rev=`git rev-parse --short HEAD`
buildString="$date-$rev"
# Replace CFBundleVersion with our string
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildString" "$buildPlist"
@ejdyksen
ejdyksen / forcepush.md
Created September 13, 2013 22:42
Recovering from a forced push

Make sure your working tree is clean. Stash or commit anything you're working on.

❯ git status
# On branch features/enrollment_popout
nothing to commit, working directory clean

Fetch the latest changes from the server.

Run VMware Fusion headless at Mac OS system startup.

I heard you like headless VMs on your Mac so I wrote this script for your launchds.

Assumptions

  • Tested on Mac OS X 10.6.4 with VMware Fusion 2.0.5 and 3.1.1.
  • A interactive user automatically logs into the system at startup. I had some issues trying to get this running without an interactive user logged in. I automatically log in for Airfoil Speakers anyway.
  • Your virtual machines live in /Virtual Machines
@ejdyksen
ejdyksen / mini-console.html
Last active September 18, 2017 22:13
A tool for getting at a JS console when there is none available.
<div id="consolelog" style="font-family: 'Courier New', Courier, monospace; font-size: 12px; margin: 40px 30px 0px; background-color: white; border: 2px solid black; padding: 10px;"></div>
<input type="text" id="consoleinput" style="margin: 0px 30px; width: 400px;" onkeypress="return evalConsoleInput(event, this.value);" />
<script type="text/javascript">
var appendConsole = function(message, type) {
var color = "black";
if (type === "error") {
color = "red";
} else if (type === "debug") {