Skip to content

Instantly share code, notes, and snippets.

orzFly /
Created Dec 15, 2020 — forked from m-radzikowski/
Minimal safe Bash script template - see the article with full description:
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
usage() {
cat <<EOF
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<div class='origin'></div>
orzFly /
Created Jul 13, 2017 — forked from joyrexus/
Nested grouping of arrays


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.

orzFly / Appex.c
Created Mar 9, 2017 — forked from blackgear/Appex.c
Generate license for AppEX
View Appex.c
#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 / aria2.rb
Created Jul 8, 2015
aria2 1.19.0 with libssh2
View aria2.rb
class Aria2 < Formula
homepage ""
url ""
sha1 "f5c6cad19fa8dda1394664d66930d59a3a7c4fa0"
depends_on "pkg-config" => :build
depends_on "c-ares" => :build
depends_on "libnettle" => :build
depends_on "libssh2" => :build
View PermutationAndCombination.cs
using System;
using System.Collections.Generic;
using System.Text;
namespace _4DigitalSolver
public class PermutationAndCombination<T>
/// <summary>
/// 交换两个变量
orzFly /
Last active Aug 29, 2015
_ = require 'lodash'
fs = require 'fs'
class Config # Singleton
constructor: (env) ->
env || = process.env.NODE_ENV
env || = 'development'
@current = @load(env)
@env = env
orzFly / nb.plugin.zsh
Last active Aug 29, 2015
NB: npm bin wrapper for zsh
View nb.plugin.zsh
#!/usr/bin/env zsh
nb() {
local npmbin="`npm bin`"
if [ ! -d "$npmbin" ]; then
echo "NB is not available at $npmbin"
return 1
local command="$1"
builtin shift 1
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 / powerline.zsh
Last active Aug 29, 2015
View 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)%}"