Skip to content

Instantly share code, notes, and snippets.

View xymostech's full-sized avatar

Emily Eisenberg xymostech

View GitHub Profile
@xymostech
xymostech / map.sh
Created June 24, 2013 19:39
Download and combine all of the map tiles from the Guild Wars 2 tile API
#!/usr/bin/env bash
for i in {0..127}; do
for j in {0..127}; do
wget -q "https://tiles.guildwars2.com/1/1/7/$i/$j.jpg" -O "$i-$j.jpg" &
done
while [ `jobs | wc -l` -gt 10 ]; do
sleep 1
done
echo "$i"
@xymostech
xymostech / bad.rs
Last active December 18, 2015 22:39
fn tupleize(num: ~int) -> (~int,) {
(num,)
}
fn main() {
let mut num = ~1;
loop {
(num,) = tupleize(num);
}
(function() {
var streams = {};
function Stream() {
this.enabled = true;
};
Stream.prototype.log = function() {
if (this.enabled) {
window.console.log.apply(window.console, Array.prototype.slice.call(arguments, 0));
/*
* Base elements
*/
body {
background: #EEE;
color: #222;
font-family: "Courier", monospace;
font-size: 16px;
margin: 0px;
min-width: 600px;
@xymostech
xymostech / Dockerfile
Created August 5, 2014 21:44
Huxley Dockerfile
FROM ubuntu:14.04
MAINTAINER xymostech <[email protected]>
RUN apt-get -qq update
RUN apt-get -qqy install nodejs default-jre firefox xvfb || true
RUN apt-get -qqy install wget
RUN wget http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
RUN ln -s /usr/bin/nodejs /usr/bin/node
ENV DISPLAY :1
CMD /bin/bash ~/run.sh
RUN echo "java -jar /selenium-server-standalone-2.42.2.jar > /dev/null &" >> ~/run.sh
@xymostech
xymostech / huxley.sh
Created August 5, 2014 22:13
Syncing Huxley screenshots from a remote docker
#!/usr/bin/env bash
echo "Syncing KaTeX directory there"
rsync --recursive --delete --links ./* KADev:docker-huxley/KaTeX/
echo "Running docker-huxley"
ssh -t KADev sudo docker run -v /home/xymostech/docker-huxley/KaTeX:/KaTeX -i -t xymostech/huxley
echo "Syncing KaTeX directory back again"
rsync --recursive KADev:docker-huxley/KaTeX/test/huxley/* ./test/huxley/
require 'json'
require 'rubygems'
require 'ttfunk'
def metrics_for_file(filename)
file = TTFunk::File.open(filename)
max_height = 0
<style type="text/css">
.katex-display {
margin: 1em 0;
text-align: center;
}
.katex-display > span {
display: inline-block;
overflow: hidden;
margin: 0 auto;
@xymostech
xymostech / clear-items.js
Last active August 29, 2015 14:14
Gists for uploading items
javascript: $.ajax({
/* Removes all the assessment items in an exercise. Set `window.exercise` to the name of
* the exercise (like `"addition_1"`). */
type: "GET",
url: "/api/v1/exercises/" + window.exercise,
success: function(data) {
var id = data.id;
var sha = data.sha;
console.log("Got id", id, "and sha", sha);
$.ajax({
@xymostech
xymostech / AphroditeLink.jsx
Created April 11, 2016 08:39
Make React Router's Link work with Aphrodite