Skip to content

Instantly share code, notes, and snippets.

View geekforbrains's full-sized avatar
🥸

Gavin Vickery geekforbrains

🥸
View GitHub Profile
@geekforbrains
geekforbrains / get_simulator_documents_path.swift
Last active May 30, 2018 08:38
Print the full path to your iOS simulators documents directory
#if arch(i386) || arch(x86_64)
let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as! NSString
NSLog("Document Path: %@", documentsPath)
#endif
@geekforbrains
geekforbrains / youtube_shortcode_example
Created June 22, 2015 19:41
An example of a YouTube embed on Postach.io
[youtube url="http://www.youtube.com/watch?v=07ds8iv1XPM" width="480" height=“320"]
@geekforbrains
geekforbrains / router.js
Last active August 29, 2015 14:22
Meteor router brainstorm
// Router with no optoins
SiteRouter = new Router();
SiteRouter.route('/', {name: 'site.index'});
SiteRouter.route('/page/:pageId', {
name: 'site.page', // automatically looks for a template named "site.page" and loads it
subs: Meteor.subscribe('pageById', this.params.pageId)
});
@geekforbrains
geekforbrains / gist:c8a11d128f13d038b119
Created April 30, 2015 18:23
Using Meteor settings (settings.json) on Heroku
heroku config:add METEOR_SETTINGS="$(cat settings.json)"
@geekforbrains
geekforbrains / postachio_example
Last active August 29, 2015 13:59
Postach.io Dropbox Markdown Example Post
title: My First Post
date: 2014-04-15
tags: life, photos
type: post
This is my first post! Hooray!
@geekforbrains
geekforbrains / consumer.js
Created April 3, 2014 20:13
ZeroMQ + Node.js Messaging Queue
var os = require('os');
var cluster = require('cluster');
var zmq = require('zmq');
if(cluster.isMaster) {
var cpuCount = os.cpus().length;
for(var i = 0; i < cpuCount; i++) cluster.fork();
} else {
var socket = zmq.socket('pull')
socket.identity = 'consumer' + process.pid;
@geekforbrains
geekforbrains / gist:8756361
Created February 1, 2014 18:27
Installing lxml via pip on Ubuntu
sudo apt-get update
sudo apt-get install libxml2
sudo apt-get install libxslt1.1
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
sudo apt-get install python-libxml2
sudo apt-get install python-libxslt1
sudo apt-get install python-dev
sudo apt-get install python-setuptools
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
{% if is_home %}
{{ site.author }}
{% elif is_post %}
{{ post.title }}
{% elif is_link %}
@geekforbrains
geekforbrains / codepen_shortcode_example
Created June 6, 2013 17:25
Codepen.io shortcode example for Postach.io embeds
[codepen url="http://codepen.io/brandonb927/pen/hkBsd" height="500" type="result"]
@geekforbrains
geekforbrains / aboutme_shortcode_example
Created June 6, 2013 17:15
About.me shortcode example for Postach.io embeds
[aboutme url="http://about.me/gavinvickery"]