This file contains hidden or 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
// 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 |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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>" |
This file contains hidden or 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
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. |
This file contains hidden or 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
__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; |
This file contains hidden or 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
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 |
This file contains hidden or 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
/* | |
Recursively traverses the given dir and returns a promise that resolves to | |
a list of files. | |
The promise is resolved only after all sub-directories being traversed. | |
*/ | |
var walkAsync = function(path) { | |
return statAsync(path).then(function(stat){ | |
if(stat.isDirectory()){ |
This file contains hidden or 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
# Definition for a binary tree node | |
# class TreeNode: | |
# def __init__(self, x): | |
# self.val = x | |
# self.left = None | |
# self.right = None | |
class BSTIterator: | |
# @param root, a binary search tree's root node | |
def __init__(self, root): |
This file contains hidden or 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
import unittest | |
import 你要測的東西 | |
class XxxSpec(unittest.TestCase): | |
def setUp(self): | |
""" | |
每個 test 前都會執行的東西。你可以塞一些常用的東西進 self。 | |
""" | |
pass | |
This file contains hidden or 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
// Webpack development server with hot module replacement enabled | |
// Ref: http://webpack.github.io/docs/webpack-dev-server.html#combining-with-an-existing-server | |
// | |
var serverCfg = require('./config'); | |
if(process.env.NODE_ENV !== 'production') { | |
var WebpackDevServer = require("webpack-dev-server"), | |
webpackCfg = require("../client/config/webpack"), | |
webpack = require("webpack"); | |
(new WebpackDevServer(webpack(webpackCfg), { |