Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

jerry lau Jerry-Lau

🎯
Focusing
View GitHub Profile
@landsman
landsman / squash-commits.sh
Created Jul 26, 2017 — forked from jbub/squash-commits.sh
git squash last two commits into one
View squash-commits.sh
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
@CraigRodrigues
CraigRodrigues / bubbleSort.js
Last active Oct 17, 2019
Bubble Sort in Javascript
View bubbleSort.js
// Normal
const bubbleSort = function(array) {
let swaps;
do {
swaps = false;
for (let i = 0; i < array.length - 1; i++) {
if (array[i] > array[i + 1]) {
let temp = array[i + 1];
array[i + 1] = array[i];
array[i] = temp;
@Jerry-Lau
Jerry-Lau / package.json
Created Mar 16, 2016
npm scripts as a build tool
View package.json
{
"scripts": {
"clean": "rm -f resources/css/style.css",
"autoprefixer": "postcss -u autoprefixer -r resources/css/style.css",
"scss": "node-sass --output-style compressed --source-map true resources/sass/PPP.scss resources/css/style.css",
"serve": "browser-sync start --proxy 'ping.dev' --files 'resources/css/*.css, resources/images/*'",
"build:css": "npm run scss && npm run autoprefixer",
"build": "npm run build:css",
"watch:css": "onchange 'resources/sass/*.scss' -- npm run build:css",
"start": "npm-run-all -p serve watch:css",
@subfuzion
subfuzion / curl.md
Last active Aug 9, 2020
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@jonsuh
jonsuh / .bash_profile
Last active Jul 21, 2020
Bash echo in color
View .bash_profile
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
@Jerry-Lau
Jerry-Lau / correct use "em" with "rem" without "px"
Last active Mar 7, 2016
correct use "em" with "rem" without "px"
View correct use "em" with "rem" without "px"
:root {
font-size: 16px;
}
// Or you can use html
// html {
// font-size: 16px;
// }
@Jerry-Lau
Jerry-Lau / centos6.5_nginx
Created Nov 23, 2015 — forked from ifels/centos6.5_nginx
centos 6.5 nginx安装与配置
View centos6.5_nginx
第一步,在/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo:
cd /etc/yum.repos.d/
vim nginx.repo
填写如下内容:
[nginx]
name=nginx repo
@Jerry-Lau
Jerry-Lau / rc meaning
Created Nov 11, 2015
What does rc mean as a file name?
View rc meaning
The ‘rc’ suffix goes back to Unix's grandparent, CTSS.
It had a command-script feature called "runcom". Early
Unixes used ‘rc’ for the name of the operating system's
boot script, as a tribute to CTSS runcom.
"http://stackoverflow.com/questions/11030552/what-does-rc-mean-in-dot-files"
@Jerry-Lau
Jerry-Lau / gulpfile.js
Created Oct 13, 2015
A personal gulp configuration file
View gulpfile.js
// require modules
var fs = require('fs');
var path = require('path');
var merge = require('merge-stream');
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var concat = require('gulp-concat'); // 合并js
var uglify = require("gulp-uglify");
@Jerry-Lau
Jerry-Lau / Gruntfile.js
Created Sep 8, 2015
Grunt file for compiling sass
View Gruntfile.js
'use strict';
/*
* Node Module
*/
module.exports = function(grunt) {
// Task configuration
grunt.initConfig({
/**
* Get package meta data
*/
You can’t perform that action at this time.