Skip to content

Instantly share code, notes, and snippets.

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

Thanh Nguyen Dac thanh4890

🏠
Working from home
View GitHub Profile

basic rules

from high priority to lower priority

  • git-history aims to help you understand life-time of the project (3)
  • keep that (history of code) clean
  • git aims to help developers' life easier (1)
  • you must pay for something (life-easy) before having it, so let's learn to using git first
  • we (you and me) don't have much fuck to give, so let's make less fuck (2)

more details

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@mori-dev
mori-dev / payjp_checkout.js
Last active June 21, 2022 08:57
PAY.JP の Checkout 用の React.js コンポーネント
// @flow
import React, { Component } from 'react';
import { findDOMNode } from 'react-dom';
class PayjpCheckout extends Component {
constructor(props: Object) {
super(props);
this.windowAlertBackUp = window.alert;
this.script = document.createElement('script');
anonymous
anonymous / provisioner-php5.5.sh
Created November 20, 2016 13:59
Scotch Box Change PHP Repository
#!/usr/bin/env bash
# Update PHP Repo
sudo rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get -y update
# Remove PHP 5.6
sudo apt-get --remove purge -y php5 php5-cli php5-curl php5-gd php5-intl php5-mcrypt php5-memcached php5-mysqlnd php5-readline php5-sqlite php5-cgi php5-common php5-fpm php5-imagick php5-json php5-memcache php5-mongo php5-pgsql php5-redis php-pear
sudo apt-get -y autoremove
@rtfpessoa
rtfpessoa / lazy-load-nvm.sh
Created August 26, 2016 11:42
NVM lazy loading script
#!/bin/bash
#
# NVM lazy loading script
#
# NVM takes on average half of a second to load, which is more than whole prezto takes to load.
# This can be noticed when you open a new shell.
# To avoid this, we are creating placeholder function
# for nvm, node, and all the node packages previously installed in the system
# to only load nvm when it is needed.
@odan
odan / xampp_php7_xdebug.md
Last active August 28, 2024 13:49
Installing Xdebug for XAMPP
@imarcelolz
imarcelolz / Vagrantfile
Last active January 8, 2016 13:00
Vagrantfile - Ubuntu 14.04.02 - rbenv and ruby 2.2.0 vm
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@bekarice
bekarice / wc-empty-cart-notice.php
Last active February 4, 2019 23:10
WooCommerce: Show a notice throughout the store if the cart is empty
/**
* Tutorial: http://www.skyverge.com/blog/check-if-woocommerce-cart-is-empty/
**/
function skyverge_empty_cart_notice() {
if ( WC()->cart->get_cart_contents_count() == 0 ) {
wc_print_notice( __( 'Get free shipping if your order is over $60!', 'woocommerce' ), 'notice' );
// Change notice text as desired
}
@leereamsnyder
leereamsnyder / wp_get_current_page_url.php
Last active August 15, 2024 19:10
In WordPress, get current URL including query string
<?php
/**
Re-use some existing WordPress functions so you don't have to write a bunch of raw PHP to check for SSL, port numbers, etc
Place in your functions.php (or re-use in a plugin)
If you absolutely don't need or want any query string, use home_url(add_query_arg(array(),$wp->request));
Hat tip to:
+ http://kovshenin.com/2012/current-url-in-wordpress/
@sebmarkbage
sebmarkbage / ReactCanvasDrawing.js
Created July 25, 2014 19:14
Canvas Drawing Example
/** @jsx React.DOM */
var Graphic = React.createClass({
componentDidMount: function() {
var context = this.getDOMNode().getContext('2d');
this.paint(context);
},
componentDidUpdate: function() {