Skip to content

Instantly share code, notes, and snippets.

source 'https://rubygems.org/'
gem 'guard'
gem 'guard-coffeescript'
gem 'guard-sass', git: 'git@github.com:alexdunae/guard-sass.git'
gem 'autoprefixer-rails'
@yosukehasumi
yosukehasumi / package.json
Created January 19, 2015 20:00
Node.js compiler
{
"scripts": {
"app": "npm run watch-css & npm run watch-coffee",
"watch-css": "watch \"npm run sass && npm run prefix\" wp-content/themes/stanns/sass/",
"watch-coffee": "watch \"npm run coffee\" wp-content/themes/stanns/coffee/",
"sass": "sass --update wp-content/themes/stanns/sass/style.scss:wp-content/themes/stanns/style.css",
"prefix": "autoprefixer wp-content/themes/stanns/style.css",
@yosukehasumi
yosukehasumi / gulpfile.js
Last active July 30, 2016 07:09
Gulp SCSS and CoffeeScript compiler
// var stylesheet_dir = "path/to/theme"
// modules
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var coffee = require('gulp-coffee');
var minifyCSS = require('gulp-clean-css');
var uglify = require('gulp-uglify');
@yosukehasumi
yosukehasumi / Gruntfile.js
Last active August 29, 2015 14:15
Gruntfile.js
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-deployments');
grunt.initConfig({
deployments: {
options: {
backups_dir: './backups'
},
local: {
"title": "Local",
@yosukehasumi
yosukehasumi / rare.sh
Last active July 13, 2017 17:29
Create a new wordpress boilerplate theme
#!/usr/bin/env bash
VERSION=2.0.12;
# Download this file, rename it to "rare", and place it in your bin directory (for mac it'll be something like usr/local/bin/rare).
# For OSX you could try this CURL command to install it:
# curl https://gist.githubusercontent.com/yosukehasumi/d0c905da78229122e7c1bb34a0fc92a7/raw/rare.sh > /usr/local/bin/rare;
# sudo chmod 755 /usr/local/bin/rare;
#
# To use this script, cd into your project directory and in command line type:
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@yosukehasumi
yosukehasumi / dbsearch.rb
Last active August 31, 2016 06:02
Search for a string in all Columns and Tables (MYSQL)
#!/usr/bin/env ruby
# Use this script to search for a string in all columns and tables in MYSQL
# INSTALLATION
# gem install mysql2
# gem install awesome_print
# gem install colorize
# USAGE
# ./dbsearch.rb 'find me in db'
@yosukehasumi
yosukehasumi / dbpull-drupal.rb
Created September 1, 2016 17:20
Pull database field relationships from Drupal
#!/usr/bin/env ruby
require 'mysql2'
require 'awesome_print'
require 'colorize'
db_name = 'db_name'
db_host = 'localhost'
db_username = 'db_user'
db_password = 'db_pass'
@yosukehasumi
yosukehasumi / git-auto-deploy.md
Last active July 25, 2023 20:07
Setting Up Git-Auto-Deploy on Digital Ocean

Install software-properties-common

sudo apt-get install software-properties-common

Add Repo

sudo add-apt-repository ppa:olipo186/git-auto-deploy
@yosukehasumi
yosukehasumi / insertParam.coffee
Created November 1, 2016 07:23
Modify URL paramaters using coffee
insertParam: (key, value) ->
key = encodeURI(key)
value = encodeURI(value)
url = document.location.search.substr(1).split('&')
for part, index in url by -1
param = part.split('=')
if param[0] == key
param[1] = value
url[index] = param.join('=')