Skip to content

Instantly share code, notes, and snippets.

View phivh's full-sized avatar
🏠
Working from home

Phi Võ (Brian) phivh

🏠
Working from home
View GitHub Profile
@phivh
phivh / sh
Created October 12, 2020 16:15
Delete all local branch that has not received any commits for a while
#!/bin/sh
date=$1
delete_local_branch () {
if [[ "$date" == "" ]]; then
echo "Missing date!"
exit
fi
for k in $(git branch | sed /\*/d); do
if [ -z "$(git log -1 --since='$date' -s $k)" ]; then
local_branch_name=$(echo $k | sed -e "s/origin\///")
GET /v1/public/characters Fetches lists of characters.
GET /v1/public/characters/{characterId} Fetches a single character by id.
GET /v1/public/characters/{characterId}/comics Fetches lists of comics filtered by a character id.
GET /v1/public/characters/{characterId}/events Fetches lists of events filtered by a character id.
GET /v1/public/characters/{characterId}/series Fetches lists of series filtered by a character id.
GET /v1/public/characters/{characterId}/stories Fetches lists of stories filtered by a character id.
GET /v1/public/comics Fetches lists of comics.
GET /v1/public/comics/{comicId} Fetches a single comic by id.
GET /v1/public/comics/{comicId}/characters Fetches lists of characters filtered by a comic id.
GET /v1/public/comics/{comicId}/creators Fetches lists of creators filtered by a comic id.
/**
* get cookie by name without using a regular expression
*/
var getCookie = function(name) {
var getCookieValues = function(cookie) {
var cookieArray = cookie.split('=');
return cookieArray[1].trim();
};
var getCookieNames = function(cookie) {
@phivh
phivh / 01-gulpfile.js
Created March 10, 2017 07:04 — forked from markgoodyear/01-gulpfile.js
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@phivh
phivh / README.md
Created March 9, 2017 04:44 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

<?php
/* RSS Cacher
*
* Keep from angering the RSS host. Go unoticed as long as possible like any
* good parasite would.
*
* We will grab the feed every 60 minutes. Hopefully that will sustain us without
* angering our host.
*
*/
@phivh
phivh / 0_reuse_code.js
Last active August 29, 2015 14:14
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