This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var x = ''; | |
function myFunction() { | |
console.log('Hello: ' + x); | |
} | |
x = 'Bob'; | |
myFunction(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gsettings set org.gnome.shell.clock show-date true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-add-repository ppa:relan/exfat | |
sudo apt-get update | |
sudo apt-get install fuse-exfat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = "teste" | |
, b = 10 | |
, variable = new Something() | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('Book', { | |
extend: 'Ext.data.Model', | |
fields: [ | |
{name: 'id', type: 'int'}, | |
{name: 'title', type: 'string'}, | |
{name: 'thumb_image_path', type: 'string'}, | |
{name: 'user_id', type: 'int'} | |
], | |
proxy: { url: "/books", type: 'rest', format: "json" } | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function($) { | |
var o = $({}); | |
$.subscribe = function() { | |
o.on.apply(o, arguments); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn plus [alpha beta] (+ alpha beta)) | |
(plus 3 4) ;; 7 | |
(plus 3 [4 5]) ;; Exception | |
(reduce plus 3 [4 5] ) ;; 12 | |
;;yay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set C-a as PREFIX | |
set -g prefix C-a | |
# set delay for other programs | |
set -s escape-time 1 | |
#set index start by 1 for window | |
set -g base-index 1 | |
#set index start by 1 for panes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Klass | |
def self.foo | |
File.open "filename", "w" do |file| | |
file.write("text") | |
end | |
end | |
end | |
NewerOlder