This file contains hidden or 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
#!/bin/bash | |
cat all.json | | |
# curl 'http://www.khanacademy.org/api/v1/videos/localized/all' | | |
jq -r ' | |
[ | |
.[] | | |
{ | |
title, | |
en_id:.youtube_ids["en"], |
This file contains hidden or 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
{- | |
The Look and Say sequence is an interesting sequence of numbers where each term is given by describing the makeup of the previous term. | |
The 1st term is given as 1. The 2nd term is 11 ('one one') because the first term (1) consisted of a single 1. The 3rd term is then 21 ('two one') because the second term consisted of two 1s. The first 6 terms are: | |
1 | |
11 | |
21 | |
1211 | |
111221 |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import requests | |
import re | |
base_link = "http://apod.nasa.gov/apod/" | |
nasa_page = requests.get(base_link) | |
if(nasa_page.status_code != 200): | |
print("Failed to downlaod page") | |
nasa_page.raise_for_status() |
This file contains hidden or 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
extern crate rustc; | |
use rustc::middle::graph; | |
use std::collections::HashMap; | |
fn main() { | |
let mut g:graph::Graph<&str,int> = graph::Graph::new(); |
This file contains hidden or 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
1A | |
CS 145 | |
Math 145 | |
Math 147 | |
Econ 101 | |
Phil 145 | |
1B | |
CS 146 | |
Math 146 | |
Math 148 |
This file contains hidden or 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
$pdf_previewer = "open -a Skim.app"; | |
$pdflatex = 'xelatex %O %S'; | |
$pdf_mode = 1; | |
$postscript_mode = $dvi_mode = 0; | |
#$aux_dir = 'aux'; | |
$out_dir = 'out'; |
This file contains hidden or 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
{-# LANGUAGE TemplateHaskell #-} | |
import Constructors | |
import Language.Haskell.TH | |
$( mkGetConstructors ''Foo ) | |
main = do putStrLn $(stringE . show =<< getConstructorNames ''Foo) | |
(putStrLn.show) constructors |
This file contains hidden or 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
#!/bin/bash | |
DLDIR=temp_youtube_downloads | |
# If there are errors, stop | |
set -e | |
if [[ $# < 1 ]]; then | |
echo "Usage: $0 youtube_url" | |
exit 1 |
This file contains hidden or 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
use std::thread; | |
use std::sync::{Mutex, Arc}; | |
use std::cell::Cell; | |
fn main() { | |
let x = Arc::new(Mutex::<i32>::new(0)); | |
let handles: Vec<_> = (1..50).map(|i| { | |
let y = x.clone(); |
This file contains hidden or 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
⚡ cargo run | |
Compiling phil v0.1.0 (file:///Users/tbelaire/Downloads/phil) | |
src/main.rs:16:5: 23:6 error: mismatched types: | |
expected `R`, | |
found `[closure src/main.rs:16:5: 23:6]` | |
(expected type parameter, | |
found closure) [E0308] | |
src/main.rs:16 || { | |
src/main.rs:17 loop { | |
src/main.rs:18 println!("philosopher {} is thinking...", i); |