Skip to content

Instantly share code, notes, and snippets.

View hashrock's full-sized avatar
🍋
Need a lemon?

hashrock hashrock

🍋
Need a lemon?
View GitHub Profile
@subfuzion
subfuzion / mongo-autostart-osx.md
Last active March 2, 2022 00:57
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

//- templated by jade
svg(width=640 height=480 style="background-color:grey;")
circle(
cx=30 cy=30
r=25
stroke="grey" stroke-width=1
fill="wheat")
rect(
width=50 height=50
x=60 y=10
@robschmuecker
robschmuecker / README.md
Last active April 24, 2024 14:12
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@hashrock
hashrock / StartMobile.html
Last active December 24, 2015 06:49
My template for iPad Web Application
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!-- for Mobile view -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<!-- iOS Application Setting -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
@shigeki
shigeki / stdin-to-ws.js
Last active October 27, 2023 16:32
標準入力をWebSocketで送信するサンプルプログラム
var http = require('http');
var WebSocketServer = require('websocket').server;
var port = 8080;
process.stdin.resume();
process.stdin.setEncoding('utf8');
var index = '<!DOCTYPE html><html><head><title>stdin-to-ws</title></head>'
+ '<body><div id="msg"></div><script>'
+ 'var msg = document.getElementById("msg");'
+ 'var ws = new WebSocket("ws:localhost:8080/stdin-to-ws", "stdin-to-ws");'
@hayajo
hayajo / changelog_en.md
Last active April 16, 2024 12:57
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@volpe28v
volpe28v / auto_scp.sh
Created March 12, 2012 09:38
scpを自動化するスクリプト
#!/bin/bash
HOST=対象ホスト名(IPアドレス)
USER=ログインユーザ
PASS=パスワード
TARGET_DIR=バックアップディレクトリ(ファイル)
BACKUP_DIR=保存先ディレクトリ
expect -c "
set timeout -1
@hail2u
hail2u / csslint-rules.md
Last active April 29, 2023 14:59
CSSLintのRulesの超訳

訳注

これは超訳です。

CSSLintは「なんでこんなルールなんだ…」とイラっとすることが多いですけど、それぞれにそれなりに理由があります。まぁ勿論無視するべきなルールとかもあります。例えば見出し要素の再定義禁止とかはHTML5に対するCSSなら無理な話です。そんなわけでどんな理由なのかを簡単に訳しました。無視するかどうかは自分で決めましょう!

この訳はCSSLintと同じライセンスで提供されます。

Possible Errors