Skip to content

Instantly share code, notes, and snippets.

View XGHeaven's full-sized avatar
🐟
Finding web future

Bradley Xu XGHeaven

🐟
Finding web future
View GitHub Profile
@XGHeaven
XGHeaven / README.md
Last active June 12, 2024 17:43
XGHeaven jsscript badge storage gist
@XGHeaven
XGHeaven / animation-diff-style.html
Last active October 16, 2022 16:37
webf-pr-11-test-example
<!DOCTYPE html>
<html>
<head>
<style>
@keyframes a {
from {
color: red;
}
to {
color: blue;
@XGHeaven
XGHeaven / canvas-2d.js
Last active August 11, 2022 15:44
WebfExample
document.body.style.background = 'black'
const width = 200
const height = 200
const canvas = document.createElement('canvas')
canvas.width = width
canvas.height = height
canvas.style.height = `${height}px`
canvas.style.width = `${width}px`
@XGHeaven
XGHeaven / centos-base.sh
Created January 18, 2018 03:36
server-init-script
# install base command
yum install zsh vim git curl -y
# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# install ivim
bash <(curl -L https://raw.githubusercontent.com/kepbod/ivim/master/setup.sh) -m
@XGHeaven
XGHeaven / index.js
Created April 23, 2017 18:12 — forked from sperand-io/index.js
Koa EventSource Streaming (SSE)
const PassThrough = require('stream').PassThrough;
const Router = require('koa-66');
const router = new Router();
const Koa = require('koa');
const app = new Koa();
// ...
router.get(`/json/data/:source`, ctx => {
const stream = new PassThrough();
@XGHeaven
XGHeaven / README.md
Created March 22, 2017 10:24
Install PHP7 on OS X El Capitan

Install PHP7 on OS X El Capitan

add the taps, unlink the old PHP if required and add php7

brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew unlink php56
brew install php70
@XGHeaven
XGHeaven / cnpm.fish
Created March 18, 2017 18:39
cnpm fish completion
# cnpm (https://cnpmjs.org) completions for Fish shell
# __fish_cnpm_needs_* and __fish_cnpm_using_* taken from:
# https://stackoverflow.com/questions/16657803/creating-autocomplete-script-with-sub-commands
# see also Fish's large set of completions for examples:
# edited based on https://github.com/fish-shell/fish-shell/tree/master/share/completions
function __fish_cnpm_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 ]
abbr -a g 'git'
abbr -a ga 'git add'
abbr -a gaa 'git add --all'
abbr -a gapa 'git add --patch'
abbr -a gb 'git branch'
abbr -a gba 'git branch -a'
abbr -a gbda 'git branch --merged | command grep -vE "^(\*|\s*master\s*\$)" | command xargs -n 1 git branch -d'
abbr -a gbl 'git blame -b -w'
abbr -a gbnm 'git branch --no-merged'
abbr -a gbr 'git branch --remote'
@XGHeaven
XGHeaven / .gitignore
Created May 1, 2016 09:48
thinkphp relative files
Runtime
Uploads
Data
.DS_Store
@XGHeaven
XGHeaven / .cvimrc
Created April 29, 2016 06:51
cVimrc
let searchengine baidu = "https://www.baidu.com/s?wd=%s"
command g tabnew google
command b tabnew baidu
let barposition = "bottom"
set cncpcompletion
let blacklists = ["https://github.com/*", "https?://localhost:*/*", "chrome://newtab/*", "https?://inbox.google.com/*", "https?://mail.google.com/*", "https?://cnode.xgheaven.cn/*"]