Skip to content

Instantly share code, notes, and snippets.

import _ from 'lodash';
_.mixin({
isInt: (value) => {
return Number(value) === value && value % 1 === 0;
},
isFloat: (value) => {
return Number(value) === value && value % 1 !== 0;
},
toBoolean: (value) => {
#!/bin/bash
DEST_DIR=dest
mkdir $DEST_DIR
for file in `find . -type f | sed 's!^.*/!!'`; do
if [[ ! "$file" =~ sh$ ]]; then
echo ${file}
`convert $file -thumbnail 20% $DEST_DIR/$file`
fi
https://github.com/defunkt/gist
# インストール
gem install gist
# OAuth認証
gist --login
> githubのユーザー・パスワードを入力
# ファイルアップロード
@underground
underground / indexedDB.js
Created September 6, 2016 01:42
Very simple indexed DB wrapper class for javascript
export default class IndexedDB {
constructor(dbName, dbVersion, stores) {
this.db;
this.dbName = dbName;
this.dbVersion = dbVersion;
this.stores = stores;
}
openDB(callback=(()=>{})) {
if (!window.indexedDB) {
@underground
underground / Dockerfile
Last active August 26, 2016 10:01
Very simple samples for pure ( for example express) web apps that run on top of Node.js
FROM node:6.4.0
WORKDIR /usr/local/src
ADD . /usr/local/src
RUN cd /usr/local/src
RUN npm install
CMD ["npm", "run", "start"]