Skip to content

Instantly share code, notes, and snippets.

View Narga's full-sized avatar

Nguyễn Đình Quân Narga

View GitHub Profile
@Narga
Narga / tlp
Created February 5, 2014 16:53 — forked from w0ng/tlp
# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# Hint: some features are disabled by default, remove the leading # to enable them
# Set to 0 to disable/1 to enable TLP
TLP_ENABLE=1
# Seconds laptop mode has to to wait after the disk goes idle before doing a sync.
# Non-zero value enables, zero disables laptop mode.
@Narga
Narga / Git Command Tricks
Created February 7, 2014 16:33
Git Command Tricks
/* Git Command Tricks
(C) 2003 Dinh Quan Nguyen a.k.a Narga <dinhquan (at) narga (dot) net>
* Website: http://www.narga.net
* http://www.narga.org
*
* You are allowed to use this software in any way you want providing:
* 1. You must retain this copyright notice at all time
* 2. You must not claim that you or any other third party is the author of this software in any way.
* 3. Feedback to me (dinhquan@narga.net) when you use my works, I will add you to customer list!
* 4. The CSS, XHTML, JS and design is released under GPL: http://www.opensource.org/licenses/gpl-license.php
@Narga
Narga / 0_reuse_code.js
Created February 10, 2014 08:55
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
@Narga
Narga / master.vim
Created February 13, 2014 15:30 — forked from gmccreight/master.vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@Narga
Narga / deploy
Created June 6, 2014 18:51 — forked from sbuzonas/deploy
#!/usr/bin/env bash
GIT_DIR_SAVE=$GIT_DIR ; unset GIT_DIR
GIT_WORK_TREE_SAVE=$GIT_WORK_TREE ; unset GIT_WORK_TREE
if [ ! -f "${OPENSHIFT_DATA_DIR}composer/bin/composer" ]; then
export COMPOSER_HOME="${OPENSHIFT_DATA_DIR}.composer"
echo $COMPOSER_HOME > ${OPENSHIFT_HOMEDIR}.env/user_vars/COMPOSER_HOME
echo "Installing composer"
curl -s https://getcomposer.org/installer | env - PATH="/usr/bin:$PATH" php -- --install-dir=$OPENSHIFT_DATA_DIR >/dev/null
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@Narga
Narga / nginx.conf
Last active August 29, 2015 14:07 — forked from deathbob/nginx.conf
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
<?php
function clear_jetpack_published() {
if(empty($_REQUEST['post'])) {
wp_die(__('Invalid post ID or action'));
}
global $wpdb;
$id = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : '';
@Narga
Narga / wp-cli.txt
Last active August 29, 2015 14:09 — forked from cfxd/wp-cli.txt
# Install wordpress
wp core download && wp core config --dbname=wordpress_test_db --dbuser=root && wp core install --url=http://localhost/wp-cli/ --title=Wordpress --admin_user=admin --admin_password=admin --admin_email=youremail@domain.com
# Install and activate Plugins
wp plugin install wordpress-importer --activate && wp plugin install contact-form-7 --activate
# Generate Posts
curl http://loripsum.wpwolf.com | wp post generate --post_content --count=10
# Activate a theme