Skip to content

Instantly share code, notes, and snippets.

@heronmedeiros
heronmedeiros / clock.sh
Created September 16, 2014 17:59
add date to global menu
gsettings set org.gnome.shell.clock show-date true
@heronmedeiros
heronmedeiros / scope.js
Created May 6, 2015 19:05
How to encapsulate js code
(function() {
var x = '';
function myFunction() {
console.log('Hello: ' + x);
}
x = 'Bob';
myFunction();
@heronmedeiros
heronmedeiros / generator-sum.py
Created May 27, 2015 17:18
Using generators in Python
# a generator that yields items instead of returning a list
def firstn(n):
num = 0
while num < n:
yield num
num += 1
sum_of_first_n = sum(firstn(1000000))