Skip to content

Instantly share code, notes, and snippets.

View Jarvis-Q's full-sized avatar
🎯
Focusing

Jarvis Jarvis-Q

🎯
Focusing
View GitHub Profile
@Jarvis-Q
Jarvis-Q / gitBranchDescription-pretty.sh
Last active September 29, 2018 09:04
get descriptions of local branches rendered as a list
#! /bin/bash
#define
COLOR_RED="\033[31m";
COLOR_GREEN="\033[32m";
COLOR_OFF="\033[0m";
# if not git repo. output warning
isExistGit=$(ls -a | grep ".git$")
if [ -z "$isExistGit" ]
@Jarvis-Q
Jarvis-Q / rails http status codes
Created August 31, 2018 12:53 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@Jarvis-Q
Jarvis-Q / canvasIMGForDownload.js
Last active July 25, 2018 14:47
transform canvas' image To blob for URL Download
function base64Img2Blob(code){
var parts = code.split(';base64,');
var contentType = parts[0].split(':')[1];
var raw = window.atob(parts[1]);
var rawLength = raw.length;
var uInt8Array = new Uint8Array(rawLength);
for (var i = 0; i < rawLength; ++i) {
uInt8Array[i] = raw.charCodeAt(i);
@Jarvis-Q
Jarvis-Q / full.js
Created May 22, 2018 10:00
fullscreen Api with god compatibility
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
@Jarvis-Q
Jarvis-Q / 0_reuse_code.js
Created June 30, 2017 10:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console