Skip to content

Instantly share code, notes, and snippets.

View MrOrz's full-sized avatar
💤
Sleepy everyday

Johnson Liang MrOrz

💤
Sleepy everyday
View GitHub Profile
@MrOrz
MrOrz / Makefile
Created March 6, 2014 18:35
My makefile for latex
TARGET = uist172-liang
PDFLATEX = /usr/texbin/pdflatex
BIBTEX = /usr/texbin/bibtex
LATEX = /usr/texbin/pdflatex
all:
$(PDFLATEX) -synctex=1 -interaction=nonstopmode $(TARGET).tex
$(BIBTEX) $(TARGET).aux
$(PDFLATEX) -synctex=1 -interaction=nonstopmode $(TARGET).tex
@MrOrz
MrOrz / gist:8717358
Created January 30, 2014 19:49
DIsable scrolling outside, scrapped from facebook's compressed JS.
__d("Scrollable", ["Event", "Parent", "UserAgent"], function(a, b, c, d, e, f) {
var g = b('Event'), h = b('Parent'), i = b('UserAgent'), j = function(event) {
var m = h.byClass(event.getTarget(), 'scrollable');
if (!m)
return;
if ((typeof event.axis !== 'undefined' && event.axis === event.HORIZONTAL_AXIS) ||
(event.wheelDeltaX && !event.wheelDeltaY) || (event.deltaX && !event.deltaY))
return;
var n = event.wheelDelta || -event.deltaY || -event.detail,
o = m.scrollHeight, p = m.clientHeight;
@MrOrz
MrOrz / snow.js
Created December 19, 2013 16:20
The script drive the bot to dig snow on start, and starts crafting snow bricks when the iron shovel is ran out, or when there is going to be full in the bot's inventory.
var mineflayer = require('mineflayer'),
repl = require("repl");
// [EDIT ME] Snow block coordinate
var SNOW_X = -516, SNOW_Y = 71, SNOW_Z = -245;
var SNOW_BRICK = 80, SNOW_BLOCK_COUNT = 4,
STONE_SHOVEL = 273, WOOD_SHOVEL = 269, IRON_SHOVEL = 256,
SNOW_POINT, SNOW_BLOCK; // Set after bot user spawns.
@MrOrz
MrOrz / fish.js
Created December 4, 2013 06:56
Mineflayer fishing bot.
var mineflayer = require('mineflayer'),
repl = require("repl");
var FISHING_ROD = 346, RAW_FISH = 349;
var FISHING_INTERVAL = 200;
var bot = mineflayer.createBot({
host: "<server>",
username: "<username>"
@MrOrz
MrOrz / xdomainrequest.js.coffee
Created September 1, 2013 16:07
Patching `XMLHttpRequest` for AngularJS and Internet Explorer < 10. It replaces the original `window.XMLHttpRequest` with a thin interface that only implements the parts AngularJS core uses. Missing methods of `XDomainRequest` are fed with `angular.noop`.
# A XMLHttpRequest wrapper for IE < 10.
# When it comes to cross domain ajax requests, it uses XDomainRequest instead.
# ** Only supports GET and POST requests! **
# Targeting IE < 10
# https://github.com/amcintyre-cs/strophejs-plugins/commit/b0a6ff2571bb70dd2f6f65c46034f4e47d75d564
return unless window.XDomainRequest and !("withCredentials" in window.XMLHttpRequest)
OriginalXMLHttpRequest = window.XMLHttpRequest
window.location.origin ?= window.location.protocol + '//' + window.location.host
@MrOrz
MrOrz / btn.sass
Created August 29, 2013 02:55
@extending a selector within the same @media directive still gives deprecation warning.
// A placeholder factory that generates a placeholder.
=btn-placeholder($border-color)
%btn
border: 1px solid $border-color
border-radius: 8px
// Generate a %btn placeholder here.
+btn-placeholder(#000)
// Use the %btn placeholder in the following two classes
@MrOrz
MrOrz / .gdbinit
Created October 13, 2012 09:37
Simple GDB Macros writen by Dan Marinescu (H-PhD)
#
# STL GDB evaluators/views/utilities - 1.03
#
# The new GDB commands:
# are entirely non instrumental
# do not depend on any "inline"(s) - e.g. size(), [], etc
# are extremely tolerant to debugger settings
#
# This file should be "included" in .gdbinit as following:
# source stl-views.gdb or just paste it into your .gdbinit file
*.mat
*.eps
@MrOrz
MrOrz / gist:2565556
Created May 1, 2012 06:19 — forked from andrewytliu/gist:1946506
2012 CCSP schedule
3/1
HTML, CSS, Layout
3/8
HTML, CSS, Layout
Project teams
HW1: CSS
DUE 3/20