Skip to content

Instantly share code, notes, and snippets.

phawk / dropbox-cursor-issues.rb
Last active Dec 28, 2015
Dropbox cursor issues
View dropbox-cursor-issues.rb
# The examples are in Ruby using RestClient (an http library)
# Already have a cursor for this user retreived the last time I called /2/files/list_folder/continue
# 1AAFFUB2KR3h0S0317__4aWVmvEQwDmIR2fdxsGL4cZGqiZjavby0HkZT70COXZm6XlswiDTQXSM7ir1qZX9uGoKGI9FbI7dSiquLv9-shzV8qOb126UToXHiKfe_oDFRzCg
resp =
cursor: "1AAFFUB2KR3h0S0317__4aWVmvEQwDmIR2fdxsGL4cZGqiZjavby0HkZT70COXZm6XlswiDTQXSM7ir1qZX9uGoKGI9FbI7dSiquLv9-shzV8qOb126UToXHiKfe_oDFRzCg"
View com.github.spotify.ngrok.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
View com.github.spotify.mac.api.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
phawk /
Last active Aug 28, 2015
Hubot spotify-mac-api client
module.exports = (robot) ->
api_url = process.env.HUBOT_SPOTIFY_MAC_API_URL
api_secret = process.env.HUBOT_SPOTIFY_MAC_API_SECRET
options = {}
options.commands = [
"play (track|artist|album) <name> - Play a given track, artist or album",
"play queue <1,2,3> - Play a given search result",
"pause - Pause the current song",
"toggle - Play/pause the current song",
phawk / .screenrc
Last active Jan 22, 2021
Sample screenrc
View .screenrc
# Save this in ~/.screenrc
# Use bash
shell /bin/bash
autodetach on
# Big scrollback
defscrollback 5000
phawk /
Created Sep 1, 2014
Middleman for usage with pow/anvil for mac
# From:
require "rubygems"
require "middleman-core/load_paths"
require "middleman-core"
require "middleman-core/preview_server"
View Gruntfile.js
/*global module:false*/
module.exports = function(grunt) {
var WEB_SERVER_PORT = 8000,
// Project configuration.
pkg: grunt.file.readJSON('package.json'),
View basic-php-nginx.conf
server {
listen 80;
server_name ~^(?P<sitename>.+)\.dev\.com$
access_log /var/www/vhosts/$sitename/logs/nginx.access.log;
error_log /var/www/vhosts/$sitename/logs/nginx.error.log;
root /var/www/vhosts/$sitename/public;
autoindex on;
index index.php;
include global/static-asset-caching.conf;
phawk /
Created Nov 25, 2013
Shows all Pull requests in the current branch not yet in origin/master. Useful for quick release notes
git log HEAD...origin/master --pretty=oneline | grep pull
View method-order.rb
def my_sample_method
# inputs
people = []
# work
people = Person.all
raise CustomError, "No people found." unless people.size > 0
# outputs
return people.to_json