Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am orzfly on github.
  • I am orzfly (https://keybase.io/orzfly) on keybase.
  • I have a public key whose fingerprint is 212F 91BE 8B18 5BE6 559F 2C27 5F93 A243 7CDC 82A7

To claim this, I am signing this object:

/**
* Event.simulate(@element, eventName[, options]) -> Element
*
* - @element: element to fire event on
* - eventName: name of event to fire (only MouseEvents and HTMLEvents interfaces are supported)
* - options: optional object to fine-tune event properties - pointerX, pointerY, ctrlKey, etc.
*
* $('foo').simulate('click'); // => fires "click" event on an element with id=foo
*
**/
@orzFly
orzFly / powerline.zsh
Last active August 29, 2015 14:13
powerline-zsh
local COLOR_FG_WHITE="%{$(tput setaf 7)%}"
local COLOR_FG_GRAY="%{$(tput setaf 8)%}"
local COLOR_FG_FAILURE="%{$(tput setaf 1)%}"
local COLOR_FG_SUCCESS="%{$(tput setaf 4)%}"
local COLOR_FG="%{$(tput setaf 0)%}"
local COLOR_BG_FAILURE="%{$(tput setab 1)%}"
local COLOR_BG_SUCCESS="%{$(tput setab 4)%}"
local COLOR_BG="%{$(tput setab 7)%}"
local COLOR_RESET="%{$(tput sgr0)%}"
readonly _ZSH_POWERLINE_SEP="$COLOR_FG_GRAY"$'\uE0B1'"$COLOR_FG"
package com.orzfly.xposed.touchwizhacker;
import android.content.res.XModuleResources;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@orzFly
orzFly / nb.plugin.zsh
Last active August 29, 2015 14:21
NB: npm bin wrapper for zsh
#!/usr/bin/env zsh
nb() {
local npmbin="`npm bin`"
if [ ! -d "$npmbin" ]; then
echo "NB is not available at $npmbin"
return 1
fi
local command="$1"
builtin shift 1
@orzFly
orzFly / config.coffee
Last active August 29, 2015 14:23
node-config-loader
_ = require 'lodash'
fs = require 'fs'
class Config # Singleton
constructor: (env) ->
env || = process.env.NODE_ENV
env || = 'development'
@current = @load(env)
@env = env
@orzFly
orzFly / PermutationAndCombination.cs
Created June 28, 2015 13:06
Bulls and Cows Solver
using System;
using System.Collections.Generic;
using System.Text;
namespace _4DigitalSolver
{
public class PermutationAndCombination<T>
{
/// <summary>
/// 交换两个变量
@orzFly
orzFly / aria2.rb
Created July 8, 2015 18:13
aria2 1.19.0 with libssh2
class Aria2 < Formula
homepage "http://aria2.sourceforge.net/"
url "http://sourceforge.net/projects/aria2/files/stable/aria2-1.19.0/aria2-1.19.0.tar.bz2"
sha1 "f5c6cad19fa8dda1394664d66930d59a3a7c4fa0"
depends_on "pkg-config" => :build
depends_on "c-ares" => :build
depends_on "libnettle" => :build
depends_on "libssh2" => :build
@orzFly
orzFly / Appex.c
Created March 9, 2017 16:50 — forked from blackgear/Appex.c
Generate license for AppEX
#include <net/if.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
int main() {
int fd;
struct ifreq ifr;
@orzFly
orzFly / README.md
Created July 13, 2017 09:02 — forked from joyrexus/README.md
Nested grouping of arrays

nest

A multi-level groupBy for arrays inspired by D3's nest operator.

Nesting allows elements in an array to be grouped into a hierarchical tree structure; think of it like the GROUP BY operator in SQL, except you can have multiple levels of grouping, and the resulting output is a tree rather than a flat table. The levels in the tree are specified by key functions.