Skip to content

Instantly share code, notes, and snippets.

View xymostech's full-sized avatar

Emily Eisenberg xymostech

View GitHub Profile
@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);
}
@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 / PKGBUILD.patch
Created March 10, 2013 01:39
Chromium no-ctrl-scroll-zoom PKGBUILD diff
--- PKGBUILD.orig 2013-03-09 20:34:31.071220631 -0500
+++ PKGBUILD 2013-03-09 20:34:34.494553772 -0500
@@ -38,6 +38,7 @@
"${pkgname}.sh"
'default'
'gcc-4.7.diff'
+ 'https://gist.github.com/xymostech/5126666/raw/5881890c82458b05871ce19e9a0f17df08f516e7/chromium-no-ctrl-scroll-zoom.patch'
'http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/www-client/chromium/files/chromium-ppapi-r0.patch'
'http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/www-client/chromium/files/chromium-gpsd-r0.patch'
# 'http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/www-client/chromium/files/chromium-system-v8-r0.patch'
@xymostech
xymostech / chromium-no-ctrl-scroll-zoom.patch
Created March 10, 2013 01:28
Make Chromium not scroll on ctrl-zoom. Use these patch files on the source directory, and then build.
--- content/browser/web_contents/web_contents_view_gtk.cc.orig 2013-03-09 20:16:51.437945192 -0500
+++ content/browser/web_contents/web_contents_view_gtk.cc 2013-03-09 20:16:56.151278267 -0500
@@ -56,6 +56,8 @@
// See tab_contents_view_views.cc for discussion of mouse scroll zooming.
gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event,
WebContentsImpl* web_contents) {
+ return FALSE;
+
if ((event->state & gtk_accelerator_get_default_mod_mask()) !=
GDK_CONTROL_MASK) {
import java.util.*;
import java.io.*;
public class Test {
public static void main(String[] args) throws FileNotFoundException, IOException {
boolean result = true;
int count = 0;
int size = Integer.parseInt(args[0]);
#ifndef ACOMMON_H
#define ACOMMON_H
#include "BCommon.h"
#include "WorkingClass.h"
#include "BrokenClass.h"
#endif /* ACOMMON_H */
@xymostech
xymostech / gist:2993640
Created June 26, 2012 06:00
setup script
#!/bin/bash
set -e
sudo apt-get update
sudo apt-get install -y ruby make ruby-dev sqlite3 libsqlite3-dev screen
if ! which gem1.8
then
curl -s -O http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
@xymostech
xymostech / gist:2933853
Created June 15, 2012 00:29
Steps on how to reproduce weird comment bug
  1. Push to a branch or forked repository, and create a pull request to the original branch/repository
  2. Close that pull request
  3. Open a new pull request from the same branch/forked repository to the same original branch/repository
  4. View the diff of the new or old pull request
    • Comments left in the old pull request will appear in the old pull request, but if the same line is clicked on the new pull request, the comment will appear
    • Comments left in the new pull request will appear, but will disappear on refresh. They will also appear on the old pull request, and will also re-appear when the line is clicked on.
  5. Enjoy the surprise comments!
@xymostech
xymostech / SConscript
Created May 29, 2012 06:02
Example SConscript
# returns the directory
def build_app(env, target, source):
env.Command(target[0], source[0],
[
Mkdir("$TARGET"),
...
])
return [target[0]]
build_app_bld = Builder(action = build_app,
@xymostech
xymostech / setup_ssh.sh
Created December 29, 2011 05:12
Help my friend set up ssh
mkdir -p ~/.ssh/
echo 'ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
ControlPersist 4h' > ~/.ssh/config
ssh-keygen -q -t rsa -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub | pbcopy