Skip to content

Instantly share code, notes, and snippets.

@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');
@rogerhub
rogerhub / monthname.php
Created January 7, 2014 21:03
Enables the %monthcode% and %monthname% tag for permalinks in WordPress.
<?php
/**
* Plugin Name: Month Name
* Description: Enables the <code>%monthcode%</code> and <code>%monthname%</code> tag for Permalinks.
* Author: Roger Chen
* License: GPLv2
*/
/**
* Enables use of monthname (january, june) and monthcode (jan, jun).
@rogerhub
rogerhub / smc.c
Created December 27, 2015 01:41
OS X script for getting fan speed and temperature, based off of Chris911/iStats
// clang -o smc smc.c -framework IOKit -framework CoreFoundation
/*
* Apple System Management Control (SMC) Tool
* Copyright (C) 2006 devnull
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
@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 / edmonds.py
Created January 9, 2014 22:16
An implementation of Edmond's Blossom Algorithm.
#!/usr/bin/env python
class Vertex:
def __init__(self, value):
self.value = value
self.edges = {}
def degree(self):
return len(self.edges)
def __str__(self):
return str(self.value)
diff --git a/configure b/configure
index f137cf1..13b04f0 100755
--- a/configure
+++ b/configure
@@ -6275,9 +6275,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#include <stdlib.h>
#include <sys/types.h>
diff --git a/configure b/configure
index f137cf1..13b04f0 100755
--- a/configure
+++ b/configure
@@ -6275,9 +6275,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#include <stdlib.h>
#include <sys/types.h>
@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");
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
@rogerhub
rogerhub / gist:7855c727d5ce284eedf2
Created January 17, 2016 06:07
Duplicity 0.7.06 segmentation fault with librsync 2.0.0 on OS X

(January 16, 2016) I encounted a segmentation fault in the function rs_search_for_block of librsync while running the Duplicity backup tool. This crash appears to be related to this bug.

In the meantime, I used the following commands to switch back to old versions of librsync and duplicity:

brew switch librsync 0.9.7
brew switch duplicity 0.6.26_1