Skip to content

Instantly share code, notes, and snippets.

@panchicore
panchicore / bash
Created October 7, 2011 00:25
solve perl: warning: Setting locale failed.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
@entaroadun
entaroadun / gist:1653794
Created January 21, 2012 20:10
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@metral
metral / ubuntu_dist_upgrade.sh
Created October 17, 2013 19:59
Non-interactive apt-get update & dist-upgrade - Ubuntu
#!/bin/bash
# update & dist-upgrade
unset UCF_FORCE_CONFFOLD
export UCF_FORCE_CONFFNEW=YES
ucf --purge /boot/grub/menu.lst
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -o Dpkg::Options::="--force-confnew" --force-yes -fuy dist-upgrade
@ddfisher
ddfisher / TypeArithmetic.rs
Last active March 19, 2021 14:39
Type-level Arithmetic in Rust
#![feature(core_intrinsics)]
// This requires unstable features to compile so we can print out the type names. The type
// arithmetic itself works fine on stable.
use std::marker::PhantomData;
enum Zero {}
enum Succ<T> {
Succ(PhantomData<T>), // only required to satisfy the compiler
@icecrime
icecrime / xkcd.py
Last active July 29, 2018 14:02
XKCD style graph
## Credits: https://jakevdp.github.io/blog/2012/10/07/xkcd-style-plots-in-matplotlib/
import numpy as np
import pylab as pl
from scipy import interpolate, signal
import matplotlib.font_manager as fm
import matplotlib.pyplot as plt
# We need a special font for the code below. It can be downloaded this way: