This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name HipChat Hide Media Previews | |
// @namespace github.com/karlding | |
// @version 0.1.0 | |
// @description Hide Media Previews (video and images) in the HipChat web client | |
// @author Karl Ding | |
// @match https://*.hipchat.com/chat/* | |
// @license MIT | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Narrator.exe] | |
"Debugger"="%1" | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\AtBroker.exe] | |
"Debugger"="%1" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name reddit Legacy Search | |
// @namespace http://github.com/karlding | |
// @version 0.1 | |
// @description Force the Legacy Search mode by adding the `feature=legacy_search` URI parameter to reddit searches | |
// @author Karl Ding | |
// @match *://*.reddit.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name XKCD Arrow Keys | |
// @namespace http://github.com/karlding | |
// @version 0.1 | |
// @description Allows you to use arrow keys to navigate on XKCD | |
// @author Karl Ding | |
// @match http*://xkcd.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdbool.h> | |
int main() { | |
union { | |
struct { | |
bool bit0 : 1; | |
bool bit1 : 1; | |
bool bit2 : 1; | |
bool bit3 : 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set the compiler name | |
CXX = g++ | |
# set the compiler flags | |
# Wall: show all warnings | |
# MMD: create dependency files | |
# g: compile binaries with debugging info | |
CXXFLAGS = -Wall -MMD -g | |
# object files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Narrator.exe] | |
"Debugger"="%1" | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\AtBroker.exe] | |
"Debugger"="%1" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// print out array in zigzag format | |
// time: O(n log n) = O(n log n) + O(n log n) + O(n) | |
// space: O(3n) | |
std::vector<int> zigZagArray(std::vector<int> intArray) { | |
std::vector<int> v(intArray); | |
// sort descending order | |
std::sort(intArray.rbegin(), intArray.rend()); | |
// sort asc | |
std::sort(v.begin(), v.end()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stack> | |
#include <vector> | |
using namespace std; | |
int main() { | |
string s; | |
stack<int> st; | |
while (cin >> s) { | |
int i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// register map | |
#define ADD 0x20 | |
#define SUB 0x22 | |
#define MULT 0x18 | |
#define MULTU 0x19 | |
#define DIV 0x1a | |
#define DIVU 0x1b | |
#define MFHI 0x10 | |
#define MFLO 0x12 | |
#define LIS 0x14 |
OlderNewer