Skip to content
View git-truncate-rev
#!/bin/bash
git checkout --orphan temp $1
git commit -m "Truncated history"
git rebase --onto temp $1 master
git branch -D temp
View AuthorizerTest.php
<?php
use Kendo\DefinitionStorage;
use SimpleApp\SimpleDefinition;
use SimpleApp\User\NormalUser;
use Kendo\RuleLoader\RuleLoader;
use Kendo\RuleLoader\DefinitionRuleLoader;
use Kendo\RuleMatcher\AccessRuleMatcher;
use Kendo\Operation\CommonOperation;
use Kendo\IdentifierProvider\ActorIdentifierProvider;
View -
#!/bin/bash
source /etc/profile
ANSI_RED="\033[31;1m"
ANSI_GREEN="\033[32;1m"
ANSI_RESET="\033[0m"
ANSI_CLEAR="\033[0K"
TRAVIS_TEST_RESULT=
TRAVIS_CMD=
View gist:815f7c976683307a02e1
phpbrew install 5.6 +default +bcmath +bz2 +calendar +cli +ctype +dom +fileinfo +filter +json \
+mbregex +mbstring +mhash +pcntl +pcre +pdo +phar +posix +readline +sockets \
+tokenizer +xml +curl +zip +openssl=yes +icu +opcache +fpm +sqlite
View GoogleSpreadSheetInviteToSlack.js
/*
The original script: https://github.com/dherbst/slack-invite-script/blob/master/code.js
*/
/*
Get channels from: curl 'https://golang.slack.com/api/channels.list?token={token}' | json_pp
*/
function getInviteChannels() {
return ['C123123123'];
View SassMeister-input.scss
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
.zoo {color: #ccc; background: #000; width: calc( 100% - 30px); }
.zoo {color: #ccc; background: #000; width: calc( 100% - 30px); }
.zoo {color: #ccc; background: #000; width: calc( 100% - 30px); }
.zoo {color: #ccc; background: #000; width: calc( 100% - 30px); }
.zoo {color: #ccc; background: #000; width: calc( 100% - 30px); }
View phpironman.vim
" Vim color file
" Author: Yo-An Lin <yoanlin93@gmail.com>
" Last Change: 2015-2-26
" Version: 1.0
" GUI only
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
View token.php
<?php
class Token
{
public $type;
public $val;
public function __construct($type, $val) {
$this->type = $type;
$this->val = $val;
View fab.asm
; nasm -f macho64 fab.asm && ld -arch x86_64 -lSystem fab.o -o fab && ./fab
global start
extern _printf
section .text
View perl5-jit-plan.md

Perl5: method based tracing for JIT (just in time complation)

During the execution:

  • Trace and collect the argument types for the method and the return value type. (some method returns mixed type variable, we should ignore that kind of the method)
  • Add the type signature to the method, each type signature refers to the compiled machine code.
  • Calculate the execution times of a method and see if it exceeds the threshold.

When compiling a method, the compiler:

Something went wrong with that request. Please try again.