Skip to content

Instantly share code, notes, and snippets.

View shomanishikawa's full-sized avatar

Shoma Nishikawa shomanishikawa

View GitHub Profile
@shomanishikawa
shomanishikawa / sequelize-migration-file-generator.js
Created July 25, 2017 00:22 — forked from manuelbieh/sequelize-migration-file-generator.js
Creates migration files for existing sequelize models
import * as models from "models";
import fs from "fs";
for(let model in models) {
let attributes = models[model].attributes;
for(let column in attributes) {
delete attributes[column].Model;
delete attributes[column].fieldName;
@shomanishikawa
shomanishikawa / slugify.js
Created July 22, 2017 16:12 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@shomanishikawa
shomanishikawa / osx-for-hackers.sh
Last active September 12, 2015 07:36 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@shomanishikawa
shomanishikawa / pu.sh
Last active September 9, 2015 12:57 — forked from AsianChris/pu.sh
Git Repo Update
#!/bin/bash
# View Delimiter
DLM='-------------------------------------'
# Set Output Colors
red=`tput setaf 1`
green=`tput setaf 2`
blue=`tput setaf 4`
cyan=`tput setaf 6`