Skip to content

Instantly share code, notes, and snippets.

@dela3499
dela3499 / common_words.txt
Created September 27, 2016 03:03
Common words (for practicing typing)
time, person, year, way, day, thing, man, world, life, hand, part, child, eye, woman, place, work, week, case, point, government, company, number, group, problem, fact, be, have, do, say, get, make, go, know, take, see, come, think, look, want, give, use, find, tell, ask, work, seem, feel, try, leave, call, good, new, first, last, long, great, little, own, other, old, right, big, high, different, small, large, next, early, young, important, few, public, bad, same, able, to, of, in, for, on, with, at, by, from, up, about, into, over, after, beneath, under, above, the, and, a, that, I, it, not, he, as, you, this, but, his, they, her, she, or, an, will, my, one, all, would, there, their
@dela3499
dela3499 / elm-package.json
Last active August 29, 2016 01:26
This is a scaffold for Elm projects. Takes care of basic imports, along with model, view, and update information.
{
"version": "1.0.0",
"summary": "helpful summary of your project, less than 80 characters",
"repository": "https://github.com/user/project.git",
"license": "BSD3",
"source-directories": [
"."
],
"exposed-modules": [],
"dependencies": {
@dela3499
dela3499 / stringsAndSums.js
Created August 26, 2016 02:16
How to convert strings to integers in JavaScript, and sum the values in an array
// Convert string to number
string = '12.1';
number = parseFloat(string);
// Convert float to int
myInt = Math.floor(number);
// Convert list of strings to list of ints
strings = ['1.1','2.1','3.1'];
numbers = strings.map(parseFloat);
@dela3499
dela3499 / print_matrix.py
Last active August 20, 2016 08:06
Print large boolean matrix row by row in a terminal (looks like a scene from the matrix)
import time
import numpy as np
def g(t):
ti = 0
for _ in range(int(1e6)):
print ' '.join(np.random.randint(2, size = 80).astype(str))
time.sleep(np.random.random() * 0.05)
ti += 0.01
if ti > t:
@dela3499
dela3499 / expand_rows.ipynb
Created August 11, 2016 02:13
Iterate over the rows of a dataframe, and expand some rows into multiple rows.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dela3499
dela3499 / french_sentences.py
Created July 5, 2016 15:40
Learn 4 French sentences
import numpy as np
import time
from IPython.display import clear_output
sentences = [
("I must eat.", "Je dois manger."),
("I want to eat.","Je veux manger."),
("I'm going to eat tomorrow.","Je vais manger demain."),
("I can't eat.","Je ne peux pas manger.")
]
@dela3499
dela3499 / newVersion.elm
Created June 17, 2016 20:29
Example use of Elm 0.17 - taking advantage of subscriptions, and tasks.
import Html.App as Html
import Html exposing ( Html, div, text )
import Html.Attributes exposing ( .. )
import Html.Events exposing ( onClick )
import Window
import Task
main = Html.program
{ init = ( ( initSize, initSize ), triggerGetSize )
@dela3499
dela3499 / song_thumnails.ipynb
Created May 8, 2016 19:43
Song thumbnails - take sections from the beginning, middle, and end of songs, and combine them into a discography-spanning summary of an artist's work.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.