Skip to content

Instantly share code, notes, and snippets.

View NotBobTheBuilder's full-sized avatar

Jack Wearden NotBobTheBuilder

View GitHub Profile
@NotBobTheBuilder
NotBobTheBuilder / python.desktop
Created March 25, 2013 21:02
.desktop file for python interpreter
[Desktop Entry]
Name=Python 3
Comment=Python
Exec=/usr/bin/python3
Terminal=true
MultipleArgs=false
Type=Application
Categories=Application;Development;
StartupNotify=true
@NotBobTheBuilder
NotBobTheBuilder / sw.py
Created August 4, 2013 15:08
Tidied up version of @cymplecy's code
#Original Code Martin Bateman 2013
#Modified by Simon Walters
#GPLv2 applies
#PC End
#V0.2 04Aug13
import sys
import time
import socket
import Tkinter as Tk
/*
* /tmp/child.js
*/
var run = function () {
console.log('awh yeah');
return 3;
};
#I'm looking for a terser way of converting a 2D list into a list of tuples and values -
#perhaps using comprehensions or zip/product/enumerate though without sacrificing readability.
#. For example:
[
[ True, True ],
[ False, False]
]
#Becomes:
[((0, 0), True), ((0, 1), True), ((1, 0), False), ((1, 1), False)
class Robot():
def __init__(self):
self._heading = 0
@property
def heading(self):
print("Getting " + str(self._heading))
return self._heading
@heading.setter
@NotBobTheBuilder
NotBobTheBuilder / palindrome_shell.py
Created April 26, 2014 21:01
palindrome_shell.py
from itertools import count
def is_palindrome(num):
return #Hmm, what could go here
total = 0
counted = 0
for i in count():
if counted >= 2000:
break
@NotBobTheBuilder
NotBobTheBuilder / code.rs
Created September 13, 2014 13:12
Minimum Breaking Example
extern crate num;
use num::bigint::BigUint;
use std::collections::treemap::TreeSet;
fn main() {
let primes = TreeSet<BigUint>::new();
}
Scala on Stilts
Python on Plane
Javascript on Jetski
Haskell on Hot Air Balloon
OCaml on Camel
var init, play, result, counter;
counter = 0;
init = result = function () {};
play = function () {
if (counter++ > 44) {
return 'dynamite';
} else {
Jacks-MacBook-Pro:juju jack$ juju charm create neo4j-charm
INFO: Using default charm template (python). To select a different template, use the -t option.
INFO: Generating charm for neo4j-charm in ./neo4j-charm
INFO: No neo4j-charm in apt cache; creating an empty charm instead.
Symlink all hooks to one python source file? [yN] n
INFO:root:Loading charm helper config from charm-helpers.yaml.
INFO:root:Checking out lp:charm-helpers to /var/folders/sw/6tqc56714c92ccn44jssxf040000gn/T/tmpG05m3W/charm-helpers.
ERROR:root:Could not sync: [Errno 2] No such file or directory
Traceback (most recent call last):
File "./scripts/charm_helpers_sync.py", line 220, in <module>