Skip to content

Instantly share code, notes, and snippets.

Avatar

Jade Edward Razoxane

View GitHub Profile
@Razoxane
Razoxane / changelog.rb
Created Aug 15, 2017 — forked from ttscoff/changelog.rb
Generate release notes from git commit messages
View changelog.rb
#!/usr/bin/ruby
# A script to automate changelog generation from Git commit messages
#
# For use with a git-flow workflow, it will take changes from the last tagged release
# where commit messages contain NEW, FIXED, and IMPROVED keywords and sort and fromat
# them into a Markdown release note list.
#
# The script takes version information from the macOS command agvtool and bases
# the product name on the first matching Xcode Info.plist found
@Razoxane
Razoxane / laravel_conditional_index_migration.php
Created Aug 8, 2017
Laravel - Create Index If Not Exists / Drop Index If Exists
View laravel_conditional_index_migration.php
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class LaravelConditionalIndexMigration extends Migration
{
/**
* Run the migrations.
@Razoxane
Razoxane / reloadCSS.js
Created Jul 28, 2017 — forked from kdzwinel/reloadCSS.js
Reload CSS files without reloading the page
View reloadCSS.js
function reloadCSS() {
const links = document.getElementsByTagName('link');
Array.from(links)
.filter(link => link.rel.toLowerCase() === 'stylesheet' && link.href)
.forEach(link => {
const url = new URL(link.href, location.href);
url.searchParams.set('forceReload', Date.now());
link.href = url.href;
});
@Razoxane
Razoxane / .gitconfig
Last active Mar 14, 2017
Git Config - Jade
View .gitconfig
[core]
editor = nano
[interactive]
singleKey = true
[push]
default = simple
[color]
ui = true
[alias]
#### Generic ####
@Razoxane
Razoxane / gitgrereplace.sh
Last active Oct 19, 2016
Git Grep Replace
View gitgrereplace.sh
git grep -lz 'AAA' | xargs -0 perl -i'' -pE "s/AAA/BBB/g"
@Razoxane
Razoxane / .gitconfig
Created Aug 15, 2016 — forked from pksunkara/.gitconfig
Sample of git config file (Example .gitconfig)
View .gitconfig
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@Razoxane
Razoxane / git-backup-to-AWS-S3.sh
Created Jun 3, 2016 — forked from philippb/git-backup-to-AWS-S3.sh
Complete git repository backup script to AWS S3
View git-backup-to-AWS-S3.sh
#!/bin/bash
# Script to backup git repo to S3
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc
bucket=$GITHUB_BACKUP_BUCKET
dir=$GITHUB_BACKUP_DIR
password=$GITHUB_BACKUP_PASSWORD
account=$GITHUB_ACCOUNT
View Default (OSX).sublime-keymap -- User
[
/* Fixes Home/End keys for OSX */
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol" } },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol" } },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true } },
{ "keys": ["super+home"], "command": "move_to", "args": {"to": "bof" } },
{ "keys": ["super+end"], "command": "move_to", "args": {"to": "eof" } },
{ "keys": ["super+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true } },
{ "keys": ["super+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true } },
@Razoxane
Razoxane / banker_round.js
Created Feb 24, 2016 — forked from FrankFang/banker_round.js
Gaussian/Banker's Rounding in JavaScript
View banker_round.js
function evenRound(num, decimalPlaces) {
var d = decimalPlaces || 0;
var m = Math.pow(10, d);
var n = +(d ? num * m : num).toFixed(8); // Avoid rounding errors
var i = Math.floor(n), f = n - i;
var e = 1e-8; // Allow for rounding errors in f
var r = (f > 0.5 - e && f < 0.5 + e) ?
((i % 2 == 0) ? i : i + 1) : Math.round(n);
return d ? r / m : r;
}
@Razoxane
Razoxane / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.