Skip to content

Instantly share code, notes, and snippets.

View kristw's full-sized avatar

Krist Wongsuphasawat kristw

View GitHub Profile
@micahstubbs
micahstubbs / .block
Last active October 17, 2016 17:15
bl.ocks metadata
license: MIT
border: no
@addyosmani
addyosmani / package.json
Last active January 18, 2024 21:31
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@MAKIO135
MAKIO135 / index.html
Last active August 22, 2019 22:53
Using canvas as ThreeJS texture
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body style="background:#fff;">
<script src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"></script>
<canvas id="canvas"></canvas>
<script id="jsbin-javascript">
@kristw
kristw / .gitconfig
Last active September 2, 2020 17:54
git alias
; from this article http://haacked.com/archive/2014/07/28/github-flow-aliases/
[alias]
aa = add -A
co = checkout
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
@rpgove
rpgove / data.tsv
Last active May 5, 2019 14:01
Force-Directed Scatterplot
sepalLength sepalWidth petalLength petalWidth species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa
4.6 3.4 1.4 0.3 setosa
5.0 3.4 1.5 0.2 setosa
4.4 2.9 1.4 0.2 setosa
@nsonnad
nsonnad / tsv2csv.py
Created November 22, 2013 11:38
Python script for converting tsv to csv
import sys
import csv
tabin = csv.reader(sys.stdin, dialect=csv.excel_tab)
commaout = csv.writer(sys.stdout, dialect=csv.excel)
for row in tabin:
commaout.writerow(row)
@hiddentao
hiddentao / gist:7300694
Last active January 22, 2019 05:04
An improvement on the angular.module() API, making it easier to split up modules into multiple files without having to worry about only registering them once.
/**
* Workaround to make defining and retrieving angular modules easier and more intuitive.
*/
(function(angular) {
var origMethod = angular.module;
var alreadyRegistered = {};
/**
@bhays
bhays / Typeahead-BS3-css
Created August 2, 2013 13:54
Bootstrap 3 style fixes for using Typeahead.js
.twitter-typeahead .tt-query,
.twitter-typeahead .tt-hint {
margin-bottom: 0;
}
.tt-hint {
display: block;
width: 100%;
height: 38px;
padding: 8px 12px;
font-size: 14px;
@voising
voising / gists_to_dash_db.rb
Last active October 21, 2021 21:32
Connect Gists with Dash (Code Snippet Manager)
#!/usr/bin/env ruby
if ARGV[0].nil? || ARGV[0].match(/-h/)
puts "Usage : #{$0} github_username dash_sqlite_db char_appended_to_keyword [no_comments]"
exit
end
require 'net/http'
require 'open-uri'
#require 'awesome_print'
@mbostock
mbostock / .block
Last active August 5, 2023 12:53
Margin Convention
license: gpl-3.0
redirect: https://observablehq.com/@d3/margin-convention