Skip to content

Instantly share code, notes, and snippets.

View xymostech's full-sized avatar

Emily Eisenberg xymostech

View GitHub Profile
This is a test
@xymostech
xymostech / orange.c
Created May 24, 2011 23:53
bittorrent programming challenge solution
/*
orange.c
Developed by xymostech on 5/24/11
Calculates the number of ways to place oranges in bowls
Such that the distance between two oranges A and B does not equal
the distance between either A or B and a third orange C
Takes about 2 seconds to run on a 2.5 GHz processor
@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
@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 / 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 / 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
#ifndef ACOMMON_H
#define ACOMMON_H
#include "BCommon.h"
#include "WorkingClass.h"
#include "BrokenClass.h"
#endif /* ACOMMON_H */
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]);
@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) {
@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'