Skip to content

Instantly share code, notes, and snippets.

@rogerhub
rogerhub / WINDOWS.md
Last active November 3, 2021 06:37
Install CS 162 Vagrant VM on Windows

Running the CS 162 Vagrant VM on Windows

There are some challenges to running Vagrant on Windows. This file is meant to provide assistance to Windows users.

1. Set up Cygwin

Cygwin provides a set of linux tools for Windows computers. You should install Cygwin and use the Cygwin terminal for SSH.

  1. Go to the Cygwin website and download setupx84_64.exe (Cygwin for 64-bit versions of Windows).
@rogerhub
rogerhub / fish_right_prompt
Created August 11, 2015 07:41
OS X Terminal.app and Fish shell intergration
function fish_right_prompt
printf "\033]7;file://localhost%s\a" (echo "$PWD" | sed -e 's/ /%20/g')
end
@rogerhub
rogerhub / .tmux.conf
Created May 20, 2015 05:05
Dot files
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# set window split
bind-key | split-window -h
bind-key - split-window
set-option -g prefix C-a
@rogerhub
rogerhub / progressreport.py
Created March 11, 2015 01:15
Simple progress report for batch jobs Python.
import time
import threading
import sys
class ProgressReport(object):
interval = 0.2
def __init__(self, name, fn):
self.job_name = name
@rogerhub
rogerhub / .tmux.conf
Created February 13, 2015 07:21
tmux config
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# set window split
bind-key | split-window -h
bind-key - split-window
set-option -g prefix C-a
@rogerhub
rogerhub / formatter.patch
Created November 6, 2014 20:50
CPPCMS Patch for ICU format ambiguous definition
Index: booster/lib/locale/src/icu/formatter.cpp
===================================================================
--- booster/lib/locale/src/icu/formatter.cpp (revision 2283)
+++ booster/lib/locale/src/icu/formatter.cpp (working copy)
@@ -58,7 +58,7 @@
virtual string_type format(int64_t value,size_t &code_points) const
{
icu::UnicodeString tmp;
- icu_fmt_->format(value,tmp);
+ icu_fmt_->format(::int64_t(value),tmp);
@rogerhub
rogerhub / download.sh
Last active August 29, 2015 14:07
Download CS162 Section stuff
curl --location -o 162_Section_7.pdf https://piazza.com/class_profile/get_resource/hxmdrtyyder49a/i1d4b7jbdfx73n &
curl --location -o 162_Section_6.pdf https://piazza.com/class_profile/get_resource/hxmdrtyyder49a/i12m2sq8vai4sn &
curl --location -o 162_Section_5.pdf https://piazza.com/class_profile/get_resource/hxmdrtyyder49a/i1038u1ffau6ba &
curl --location -o 162_Section_4.pdf https://piazza.com/class_profile/get_resource/hxmdrtyyder49a/i0iskc99hkb6e2 &
curl --location -o 162_Section_3.pdf https://piazza.com/class_profile/get_resource/hxmdrtyyder49a/i08nmvwvdy97kv &
curl --location -o 162_Section_2.pdf https://piazza.com/class_profile/get_resource/hxmdrtyyder49a/hzz2riroivm22w &
curl --location -o 162_Section_1.pdf https://piazza.com/class_profile/get_resource/hxmdrtyyder49a/hzz2rc7db2f20m &
curl --location -o 162_Section_7_Solutions.pdf https://piazza.com/class_profile/get_resource/hxmdrtyyder49a/i1d4be9z5ps4pu &
curl --location -o 162_S
var k = document.getElementsByClassName("resource_title");
for (var i = 0; i < k.length; i++) { console.log(k[i].href); }
@rogerhub
rogerhub / pandagrader.user.js
Created October 4, 2014 23:19
Change 'Gradescope' back to 'Pandagrader'
// ==UserScript==
// @name Change gradescope to pandagrader
// @namespace http://rogerhub.com/
// @version 0.1
// @match https://www.gradescope.com/*
// @run-at document-end
// ==/UserScript==
document.title = document.title.replace("Gradescope", "Pandagrader");
@rogerhub
rogerhub / bitbucket.user.js
Last active July 8, 2022 15:41
UI enhancements for Bitbucket.org
// ==UserScript==
// @name Bitbucket UI Enhancement
// @namespace http://rogerhub.com/
// @version 0.1
// @match https://bitbucket.org
// @run-at document-end
// ==/UserScript==
var style_element = document.createElement('style');
style_element.setAttribute('type', 'text/css');