Skip to content

Instantly share code, notes, and snippets.

View enkr1's full-sized avatar
🎯
If you actually try your best, you can't lose.

ENKR | Jing Hui PANG | 彭竞辉 enkr1

🎯
If you actually try your best, you can't lose.
View GitHub Profile
@nickcooley
nickcooley / _basics.scss
Created December 5, 2011 03:28
SASS Sample Files
body {
text-align: center;
> #container {
text-align:left;
margin:0 auto;
width:500px;
}
}
@tsironis
tsironis / dabblet.css
Created January 16, 2012 18:08
Calculator, hand-coded only with HTML and CSS3.
/**
* Calculator, hand-coded only with HTML and CSS3.
*/
body {background: #eee;}
h1 {text-align: center; font-family: 'Consolas', monospace; font-weight: normal; font-size: 3em;}
#calc {
width: 250px;
padding: 25px;
@digitaljhelms
digitaljhelms / gist:4287848
Last active July 19, 2024 03:32
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@vratiu
vratiu / .bash_aliases
Last active July 23, 2024 09:19
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@ericavonb
ericavonb / git-commit-style-guide.md
Last active July 22, 2024 08:12
Git Commit Style Guide

Git Commit Style Guide

Inspiration: Deis Commit Style Guide

I often quote Deis in sections below.

Motivation

It makes going back and reading commits easier. It also allows you to spend less time thinking about what your commit message should be.

@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@parmentf
parmentf / GitCommitEmoji.md
Last active July 23, 2024 11:27
Git Commit message Emoji
@hohl
hohl / .htaccess
Last active July 19, 2023 05:19
rewrite URLs to remove .html ending and always hide "index.html"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301]
RewriteCond %{THE_REQUEST} ^GET\ (.*)\.html\ HTTP
@RickieL
RickieL / launch-nmp.sh
Last active July 18, 2022 03:38 — forked from un1ko85/new_gist_file.sh
Starting and stopping NginX / MySQL / PHP-FPM on Mac OS X
#!/usr/local/bin/zsh
DirConf="/usr/local/etc"
PIDPATH="/usr/local/var/run"
PHPVersion="5.6"
MYSQL="/usr/local/bin/mysql.server"
NGINX="/usr/local/bin/nginx"
PHPFPM="/usr/local/sbin/php-fpm"
MEMCACHED="/usr/local/bin/memcached -m 24 -P $PIDPATH/memcached.pid -u root"
@garvs
garvs / wc-assign-other-role-instead-customer.php
Created May 5, 2016 01:15
Assign to new WooCommerce registered user another role instead of customer
/**
* Replace 'customer' role (WooCommerce use by default) with your own one.
**/
add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1);
function wc_assign_custom_role($args) {
$args['role'] = 'subscriber';
return $args;
}