Skip to content

Instantly share code, notes, and snippets.

Peter Lyons focusaurus

Block or report user

Report or block focusaurus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@focusaurus
focusaurus / keybase.md
Created Apr 8, 2014
claiming my github focusaurus identity for keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am focusaurus on github.
  • I am focusaurus (https://keybase.io/focusaurus) on keybase.
  • I have a public key whose fingerprint is 6B5E E932 7443 38B7 F12F F706 B2C9 23F1 E205 D5C6

To claim this, I am signing this object:

@focusaurus
focusaurus / index.html
Created Jul 20, 2014
moo.com business card done in HTML/CSS
View index.html
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
@focusaurus
focusaurus / create-github-milestone.js
Last active Aug 29, 2015
node.js script to create a github milestone
View create-github-milestone.js
#!/usr/bin/env node
var request = require('superagent');
var config = require('config');
var GITHUB_API_URL = 'https://api.github.com';
var MILESTONES = '/repos/owner/project/milestones';
request.post(GITHUB_API_URL + MILESTONES)
.set('Authorization', 'token ' + config.githubToken)
.set('User-Agent', 'focusaurus-create-github-milestone')
.send({title: process.argv[2]}).end(function (error, res) {
console.log(error, res.text);
@focusaurus
focusaurus / moin_to_markdown.py
Created Sep 2, 2014
Use for inspiration only. Very much a 1-off tool limited to a specific migration's needs.
View moin_to_markdown.py
#!/usr/bin/python
# This is a simple script to convert a very limited set of MoinMoin wiki syntax
#to markdown. I am using it in my migration from MoinMoin to a gitit+markdown
#wiki.
DO_GIT = False
#DISABLED#DO_GIT = True
import os
import re
REPLACEMENTS = (
("(./)", "[x]"),
@focusaurus
focusaurus / gist:b7f59b029f66e6b661cf
Created Jun 18, 2015
Review: Metaprogramming in ES6: Symbols and why they're awesome
View gist:b7f59b029f66e6b661cf
class BoringClass  
end  
class CoolClass  
  def ==(other_object)
   other_object.is_a? MyClass
  end
end  
BoringClass.new == BoringClass.new #=> false  
CoolClass.new == CoolClass.new #=> true!  
@focusaurus
focusaurus / gist:03b814ea78e3952749dd
Created Jun 26, 2015
DB integrity checker instructions
View gist:03b814ea78e3952749dd

Hi friend! So I just put up an alpha of my data analyzer that can scan any mongodb or couchdb server you can access from your laptop (including your local dev ones). It works by ssh tunneling and the "UI" is all ssh.

Could you give it a try and see what it says about your data?

Here's how to run it:

  1. ssh setup@carson.peterlyons.com
  • use password "password" when prompted
  1. Answer the questions about your db server it asks you
  • it will print another longer ssh command
@focusaurus
focusaurus / atom packages
Created Jan 13, 2015
Atom text editor setup 2015-01-12
View atom packages
atom-beautify
atom-color-highlight
autoclose-html
autocomplete-plus
git-blame
git-plus
jsdoc
jsformat
language-docker
language-dockerfile
@focusaurus
focusaurus / comcast.sh
Created Sep 17, 2015
using the "comcast" utility to throttle network traffic to a specific application
View comcast.sh
# https://github.com/tylertreat/Comcast
# In this example, the application I want to throttle is on TCP port 9110
comcast="${HOME}/projects/comcast/bin/comcast"
throttle() {
local profile="${1-wifi}"
local bandwidth=30000
local latency=40
@focusaurus
focusaurus / debug.coffee
Created Mar 30, 2011
CoffeeScript Introspection Function
View debug.coffee
debug = (obj, seen)->
printProps = (obj)->
#Edge case to handle is [1,2,3][9] = 'foo'
#Need to factor the conditional out to check if the prop is a number less
#than the array's length
return ((if ! /^\d+$/.test prop then prop + ": " + debug(obj[prop], seen) \
else '') for prop of obj).join(', ')
seen = seen or []
if obj in seen
View default.rb
require 'rubygems'
require 'json'
CONF_PATH = '/tmp/clouddial_conf.json'
cookbook_file CONF_PATH do
source File.basename CONF_PATH
mode '0444'
backup false
end
You can’t perform that action at this time.