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
#!/bin/bash | |
# | |
# Copyright (c) 2014, Intel Corporation | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# * Redistributions of source code must retain the above copyright notice, | |
# this list of conditions and the following disclaimer. | |
# * Redistributions in binary form must reproduce the above copyright |
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
#!/bin/bash | |
_liquibase() | |
{ | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
local prv=${COMP_WORDS[COMP_CWORD-1]} | |
local opts cmds | |
opts="$(liquibase --help 2>&1 | grep -e '^ --[a-z][a-zA-Z]*' -o)" | |
cmds="$(liquibase --help 2>&1 | grep -e '^ [a-zA-Z]\+' -o)" |
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 iVoc | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description save your search history on bing/dict! | |
// @author zyguan | |
// @match https://cn.bing.com/dict* | |
// @grant GM_getValue | |
// @grant GM_setValue | |
// @grant GM_deleteValue |
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 bilibot | |
// @namespace http://live.bilibili.com/ | |
// @version 0.1 | |
// @description get your award automatically | |
// @author zyguan | |
// @include http://live.bilibili.com/* | |
// @exclude http://live.bilibili.com/ | |
// @grant none | |
// @require https://github.com/antimatter15/ocrad.js/raw/master/ocrad.js |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
from inspect import isgenerator | |
def fact(n): | |
if n <= 1: | |
return n | |
else: | |
f = yield fact(n-1) | |
return f * n | |
def fib(n): |
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
// Copyright 2011 Bobby Powers. All rights reserved. | |
// Use of this source code is governed by the MIT | |
// license that can be found in the LICENSE file. | |
// based off of Appendix A from http://dinosaur.compilertools.net/yacc/ | |
// original work: https://github.com/golang-samples/yacc | |
%{ |
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
body { | |
background-color: gray; | |
} | |
article { | |
width:720px; | |
margin:auto; | |
margin-top: -10px; | |
font-family:helvetica, | |
verdana, sans-serif; | |
padding-bottom:3em; |
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
#! /bin/sh | |
repos="http://maven.oschina.net/content/groups/public/" | |
mvn dependency:get -DremoteRepositories="$repos" -Dartifact="$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
-- Firefox saves your browsing history data in places.sqlite. So it's | |
-- possible to know about your behavior by a sql select statement. | |
-- Here is an example. | |
-- | |
-- (https://support.mozilla.org/en-US/kb/recovering-important-data-from-an-old-profile) | |
-- | |
SELECT host, count(*) FROM moz_historyvisits h LEFT JOIN | |
(SELECT id, substr(substr(url, instr(url,'://')+3), | |
0,instr(substr(url, instr(url,'://')+3),'/')) AS host |
NewerOlder