Skip to content

Instantly share code, notes, and snippets.

View parente's full-sized avatar
🦡

Peter Parente parente

🦡
View GitHub Profile
@parente
parente / guess.js
Created February 7, 2014 20:41
Guessing game for TotT
/*
Write a JS guessing game that picks a random, secret number between 1 and 100, lets the user take up to 5 guesses, and states if the secret number is equal to, higher, lower than a guess. Read input from stdin and print to stdout.
*/
var correct = Math.floor(Math.random()*100)+1;
// console.log(correct);
var MAX_TRIES = 5;
var readline = require('readline');
var rl = readline.createInterface(process.stdin, process.stdout);
var guesses = 0;
@parente
parente / wine analysis.ipynb
Created February 15, 2014 19:11
TotT IPython Notebook for the example wine dataset analysis. See http://tott-meetup.readthedocs.org/en/latest/sessions/ipython.html
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parente
parente / Vagrantfile
Last active August 29, 2015 13:57
Multi-VM Vagrantfile template w/ Docker exposed
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install lxc-docker
sudo usermod -a -G docker vagrant
@parente
parente / keybase.md
Created April 15, 2014 14:39
keybase.md

Keybase proof

I hereby claim:

  • I am parente on github.
  • I am parente (https://keybase.io/parente) on keybase.
  • I have a public key whose fingerprint is F020 F9E1 4991 B4A8 41BF 948E 573D 3A78 5F16 E056

To claim this, I am signing this object:

@parente
parente / domper.go
Last active August 29, 2015 14:04
Docker index/registry repository and image metadata dumper
package main
import (
"os"
"fmt"
"net/http"
"net/http/httputil"
"strings"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"
@parente
parente / junk_dockerfile
Last active August 29, 2015 14:06
CMD / ENTRYPOINT study
FROM busybox
ENV name1 value1
ENTRYPOINT ["ls"]
CMD /bin/sh
CMD ["/bin/sh"]
CMD ls
CMD -l
EXPOSE 1234
ENV name2 value2
@parente
parente / ld.py
Created October 4, 2014 00:58
Levenshtein distance with operation sequence
#!/usr/bin/python
'''
Toying with Levenshtein Distance. Quick and dirty impl.
Copyright (c) Peter Parente 2011. All Rights Reserved.
Licensed under the WTFPL. http://sam.zoy.org/wtfpl/
'''
def permute(s, ops, t=None):
'''Permute string s with ops and assert it matches t.'''
@parente
parente / KenBurns.js
Created October 4, 2014 01:02
Ken Burns effect in Dojo
/**
* Ken Burns effect in a Dojo widget.
*
* Copyright (c) 2009 Peter Parente under the terms of the BSD license.
* http://creativecommons.org/licenses/BSD/
*/
dojo.provide('info.mindtrove.KenBurns');
dojo.require('dojo.fx');
dojo.require('dojo.fx.easing');
dojo.require('dijit._Widget');
@parente
parente / voices.txt
Created January 7, 2015 00:40
Chrome 39.0.2171.95 speechSynthesis.getVoices() name and localService values on OS X 10.10
Google US English false
Google UK English Male false
Google UK English Female false
Google Español false
Google Français false
Google Italiano false
Google Deutsch false
Google 日本人 false
Google 한국의 false
Google 中国的 false
@parente
parente / gist:c4ce8c138ed3b2fa3249
Created January 16, 2015 20:03
ipython js merge test failures
PASS Cell 2 is splittable
PASS Cell 2 is mergeable
FAIL Merge cell 0 down: There are still 3 cells
# type: assertEquals
# file: /Users/parente/projects/ipython/IPython/html/tests/notebook/dualmode_merge.js:74
# code: this.test.assertEquals(this.get_cells_length(), 3, 'Merge cell 0 down: There are still 3 cells');
# subject: 4
# expected: 3
FAIL Merge cell 1 up: There are still 3 cells
# type: assertEquals