Skip to content

Instantly share code, notes, and snippets.

View trungx's full-sized avatar
🚩
Go to 2022

trungx

🚩
Go to 2022
View GitHub Profile
@pnlinh
pnlinh / Install env OSX
Created September 8, 2018 09:59 — forked from tulanhtieu90/Install env OSX
Install env for web develop with nginx, php, mysql, git...
# Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
# Zsh (can skip)
brew install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
brew install nginx
@viettranx
viettranx / FreezeAndSeal.example.js
Created August 26, 2018 18:08
How to make a private variable in Class and prevent add/delete it with freeze and seal function.
// ES6
// A normal object
class iPhoneX {
secretName = 'iPhoneX'
constructor(price) {
this.price = price
}
setPrice = (value) => {
@trungx
trungx / .gitconfig
Created August 21, 2018 02:18 — forked from pnlinh/.gitconfig
Git Aliases
[alias]
a = add .
aliases = config --get-regexp alias
b = branch
bi = bisect
ci = commit -m
co = checkout
colast = checkout -
db = branch -D
laf = fsck --lost-found
@pnlinh
pnlinh / .gitconfig
Created August 21, 2018 02:11 — forked from nickytonline/.gitconfig
Git Aliases
[alias]
a = add .
aliases = config --get-regexp alias
b = branch
bi = bisect
ci = commit -m
co = checkout
colast = checkout -
db = branch -D
laf = fsck --lost-found
<!DOCTYPE html>
<html>
<head>
<title>Google Fonts Preview</title>
<style>
#preview {
margin: 0 auto;
text-align: center;
width: 80%;
}
@liqtags
liqtags / shopify-liquid-cheatsheet.liquid
Created July 25, 2018 12:03
Shopify Liquid Cheatsheet
Shopify objects that contain attributes that can be dynamically put on the page. For example, the product object contains an attribute called title that can be used to output the title of a product.
The handle is used to access the attributes of a Liquid object. By default, it is the object’s title in lowercase with any spaces and special characters replaced by hyphens (-). Every object in Liquid (product, collection, blog, menu) has a handle.
Collections & Products
Collection ►
all_types ►
Returns a list of all the product types for a collection
@mabuak
mabuak / fileUploadTrait.php
Created May 19, 2018 09:27
Laravel File Upload Trait
<?php
/**
* Created by PhpStorm.
* User: DhanPris
* Date: 15/05/2018
* Time: 11:51
*/
namespace App\Http\Traits;
@giapt
giapt / php7_pthreads.sh
Last active May 8, 2018 07:19
PHP7 with Thread
#!/bin/bash
apt-get update
apt-get install -y libzip-dev bison autoconf build-essential pkg-config git-core \
libltdl-dev libbz2-dev libxml2-dev libxslt1-dev libssl-dev libicu-dev \
libpspell-dev libenchant-dev libmcrypt-dev libpng-dev libjpeg8-dev \
libfreetype6-dev libmysqlclient-dev libreadline-dev libcurl4-openssl-dev
rm -rf /etc/php7
mkdir -p /etc/php7
mkdir -p /etc/php7/cli
@ericclemmons
ericclemmons / README.md
Created April 15, 2018 23:36
Hot take on Zach Silveira's Gutenblock Demo!
@trungx
trungx / revert_a_merge.md
Created April 6, 2018 02:50 — forked from lifuzu/revert_a_merge.md
revert a merge commit that's already pushed to remote branch

The -m option specifies the parent number. This is because a merge commit has more than one parent, and Git does not know automatically which parent was the mainline, and which parent was the branch you want to un-merge.

When you view a merge commit in the output of git log, you will see its parents listed on the line that begins with Merge:

commit 8f937c683929b08379097828c8a04350b9b8e183
Merge: 8989ee0 7c6b236
Author: Ben James <[email protected]>
Date:   Wed Aug 17 22:49:41 2011 +0100

Merge branch 'gh-pages'