Skip to content

Instantly share code, notes, and snippets.

View layerssss's full-sized avatar

Michael Yin layerssss

View GitHub Profile
@sfcgeorge
sfcgeorge / scenic_view_sort_patch.rb
Created December 16, 2019 11:05
Patch 1 method in Scenic's schema dumper so that views are sorted first alphabetically, and then have any dependencies resolved.
# frozen_string_literal: true
require 'rails'
require 'scenic'
module Scenic
# @api private
module SchemaDumper
private
@tonytonyjan
tonytonyjan / copyExif.js
Last active December 16, 2023 11:43
copy EXIF from one JPEG blob to another and return a new JPEG blob.
// Copyright (c) 2019 Weihang Jian <tonytonyjan@gmail.com>
export default async (src, dest) => {
const exif = await retrieveExif(src);
return new Blob([dest.slice(0, 2), exif, dest.slice(2)], {
type: "image/jpeg"
});
};
export const SOS = 0xffda,
@int128
int128 / README.md
Last active January 21, 2024 14:52
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

@layerssss
layerssss / plates_c.rb
Last active August 29, 2015 14:21
珠海车牌自选号
aa = [
'CRC',
'CDN',
'CSS',
'CPP',
'CPU',
'CRT',
'CDR',
'CES',
'CFG',
@layerssss
layerssss / zeus_shim.sh
Last active December 31, 2015 14:59
use [zeus](https://github.com/burke/zeus) as a shim
# Usage:
#
# Paste these functions into your `.*shrc`, and re-open a new session. Then
# you can use `rails`, `rake`, `rspec` to launch their zeus equivalance. If you
# need to invoke a bash script contains those commands, you'll have to call it
# by `source xxxx.sh`.
#
# It works under rbenv. But not tested under rvm (rvm use shell functions, so it may
# not be compliant with these functions)
@yefuchs
yefuchs / gfw_contributors.md
Last active March 4, 2024 05:24
GFW Contributers

#The Great Firewall (GFW) Contributors List

注:数据来源为 dblp 和 cndblp, 下面括号中的数字表示 dblp 中显示的跟方滨兴合作论文的数量

###Binxing Fang (方滨兴)

中国工程院院士,北京邮电大学教授,中国科学院计算技术研究所网络方向首席科学家
http://en.wikipedia.org/wiki/Fang_Binxing

@dvdsgl
dvdsgl / Procfile
Created February 25, 2012 21:58
Automated Jenkins Comments on GitHub Pull Requests
web: node server.js
@agnoster
agnoster / .vimrc
Created October 22, 2010 09:12
.vimrc excerpt for remapping keys on a Dvorak keyboard
" Dvorak remap
" 1 - Movement keys htns -> hjkl
" (gj and gk move by visual lines, if the line is wrapped for instance)
noremap h h
noremap t gj
noremap n gk
noremap s l
" 2 - replace functions we remapped away
" S goes to bottom of Screen
noremap S L