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
http://meteortips.com/tutorial/twitter-login-provider/
@hashrock
hashrock / pattern.js
Created May 11, 2015 04:14
JS study : pattern
// https://blog.svpino.com/2015/05/08/solution-to-problem-5-and-some-other-thoughts-about-this-type-of-questions
function generatePattern(result, nowList, chars, n){
if(n > 0){
chars.forEach(function(item){
generatePattern(result, nowList.concat(item), chars, n-1)
})
}else{
result.push(nowList);
}
@hashrock
hashrock / permutation.js
Created May 11, 2015 04:17
permutation
// pure js version of http://qiita.com/higuma/items/5af4e62bdf4df42ce673
function perm(result, l, r, n){
if(n > 0){
r.forEach(function(item, i){
var rest = r.slice(0);
var e = rest.splice(i, 1);
perm(result, l.concat(e), rest, n - 1);
})
}else{
@hashrock
hashrock / gist:c35b5849c60e3bc8e22d
Created May 13, 2015 06:19
GitBucket CSS改善案
//リストは全体がclickableであるべき
ul.sidemenu li a {
display: block;
}
//ロゴずれてる
.navbar .brand {
padding-top: 9px;
padding-bottom: 6px;
@hashrock
hashrock / index.html
Created June 30, 2015 02:52
vue.js test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="taskapp" v-repeat="task :tasks">
{{task.title}}
@hashrock
hashrock / diag.md
Last active February 26, 2024 05:51
作図系ツール・ライブラリまとめ

シーケンス図とかフローチャートをしごとで描画することになった場合、 テキストから生成できたら楽なので、それ系のツールまとめ

GraphViz

http://www.graphviz.org/

  • C製
  • Doxygen, Moinmoinなどと連携可能
  • ブロック図、クラス図、ネットワーク図など
@hashrock
hashrock / git.md
Created October 21, 2015 06:45
git備忘録

originの最新をupstreamの最新に強制的に合わせる

git remote add upstream /url/to/original/repo
git fetch upstream
git checkout master
git reset --hard upstream/master  
git push origin master --force 
@hashrock
hashrock / onefile_cms.html
Last active April 23, 2019 04:03
1 File CMS
<!--
http = require('http'),
fs = require('fs'),
qs = require('querystring');
http.createServer(function (req, res) {
var someFile = "index.html";
if (req.method === 'POST') {
var body = '';
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sanitize Sample</title>
</head>
<body>
<main>
<h1>Sanitize Sample</h1>
<ul>
filters: {
formatDate: function (v) {
return v.replace(/T|Z/g, ' ').replace(/\.[0-9][0-9][0-9]/, "")
}
}