Skip to content

Instantly share code, notes, and snippets.

On the way to refactoring

othree othree

On the way to refactoring
Block or report user

Report or block othree

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@othree
othree / dwbp.md
Created Feb 20, 2017
Data on the Web Best Practices
View dwbp.md
  • Metadata
    • Provide metadata
    • Provide descriptive metadata
    • Provide structural metadata
  • Data Licenses
    • Provide data license information
  • Data Provenance
    • Provide data provenance information
  • Data Quality
    • Provide data quality information
View secret-es.mdown
View fetch multiple json2.js
const all = Promise.all.bind(Promise);
const fetchJSON = async file => (await fetch(file)).json();
const grabData = async files => await all(files.map(fetchJSON));
(async () => {
let [data1, data2] = await grabData(['/data1.json', '/data2.json']);
})();
View fetch multiple json.js
const all = Promise.all.bind(Promise);
const grabData = async files => await all(
(
await all(
files.map(f => fetch(f))
)
).map(v => v.json())
);
View gulp-rollup-react.js
var gulp = require('gulp');
var rollup = require('rollup').rollup;
var nodeResolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var typescript = require('rollup-plugin-typescript');
var replace = require('rollup-plugin-replace');
gulp.task('default', ['bundle']);
gulp.task('bundle', function () {
View change-cwd-when-insert.vim
:autocmd InsertEnter * let save_cwd = getcwd() | execute 'lcd %:p:h'
:autocmd InsertLeave * execute 'lcd' fnameescape(save_cwd)
View forward ssh key
setfacl -m u:http:rw $SSH_AUTH_SOCK
setfacl -m u:http:x $(dirname $SSH_AUTH_SOCK)
sudo -u http -s /bin/sh -c "env SSH_AUTH_SOCK=$SSH_AUTH_SOCK git pull"
View nginx.conf of blog
error_page 404 /about/404/;
location / {
root /var/www/blog;
index index.php;
location ~* \.(js|css|jpg|jpeg|gif|png|ico|xsl)$ {
location ~* \.(js|css|xsl)$ {
expires 1d;
}
View libbrotli.rb
class Libbrotli < Formula
desc "Brotli library for decode and encode"
homepage "https://github.com/bagder/libbrotli"
url "https://github.com/bagder/libbrotli/archive/libbrotli-1.0.tar.gz"
sha256 "5b7c02eb87017e7b3886c07eca685db95fa21f9c8afbb442469370c251a54dc1"
option :universal
depends_on "libtool" => :build
depends_on "automake" => :build
View g0v-summit-216-json-ld.json
{
"@context":"http://schema.org",
"@type":"Event",
"name":"g0v Summit 2016 Conference",
"url":"http://summit.g0v.tw/2016/",
"startDate":"2016-05-14T09:00:00.000+08:00",
"endDate":"2016-05-15T17:40:00.000+08:00",
"location":{
"@type":"EventVenue",
"name":"中研院人文社會科學館 / Social Sciences Building, Academia Sinica, Taipei, Taiwan",
You can’t perform that action at this time.