Skip to content

Instantly share code, notes, and snippets.

View nntoan's full-sized avatar
🌀

Toan Nguyen nntoan

🌀
View GitHub Profile
@nntoan
nntoan / nginx.conf
Last active August 29, 2015 14:20 — forked from bearlikelion/nginx.conf
server {
listen *:80;
server_name mark.dev;
root /home/mark/dev/src/public;
index index.php;
location / {
# rewrite URL to remove trailing forward slash /
rewrite ^/(.*)/$ /$1 permanent;
@nntoan
nntoan / hhvm.hdf
Last active August 29, 2015 14:20 — forked from bearlikelion/hhvm.hdf
# hhvm --mode daemon -vServer.Type=fastcgi -vServer.Port=9001 --config /etc/hhvm.hdf
PidFile = /var/run/hhvm.pid
ServerVariables {
ENVIRONMENT = DEVELOPMENT
}
Log {
UseLogFile = true
@nntoan
nntoan / make-flashlight-work-on.yosemite.md
Last active August 29, 2015 14:26 — forked from selaromi/make-flashlight-work-on.yosemite.md
Steps to make Flashlight work on 10.10.4 (doesn't work for El Capitan)

Make Flashlight work on 10.10.4

  1. Install SIMBL http://culater.net/software/SIMBL/SIMBL.php
  2. Copy SpotlightSIMBL.bundle to /Library/Application Support/SIMBL/Plugins/ (a)
  3. Copy Flashlight.osax to ~/Library/ScriptingAdditions/ (b)
  4. Disable Flashlight
  5. Enable Flashlight
  6. Open Script Editor on your Mac (look for "Script Editor In Spotlight") and paste the following code (don't change Snow Leopard for Yosemite)
tell application "Spotlight" to inject SIMBL into Snow Leopard
/*
* BOT for 10fastfingers, automatic typing with adjustable speed
* ================================================================
*
* bored in my apartment and decided to hack this game: http://indonesian-speedtest.10fastfingers.com/
* just start the game, when you're ready to type, DON'T TYPE ANYTHING, open up
* your Developer Tools in Chrome (CTRL+SHIFT+J) and click Console tab, and
* then paste the whole code below, then press enter, and enjoy the show.
*
* twitter.com/kecebongsoft
using System;
using System.Collections.Generic;
using System.Linq;
using AwesomiumSharp;
using System.Threading;
namespace Automation
{
class AutomationSample
{
@nntoan
nntoan / nginx.conf
Created July 22, 2015 11:27
NodeJs + Nginx
upstream node {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name yoursite.com;
root /path/to/node/app/public;
location / {
@nntoan
nntoan / customers.sql
Created March 23, 2016 07:37 — forked from leek/_Magento1_DeleteTestData.md
Magento - Delete All Test Data
SET FOREIGN_KEY_CHECKS=0;
-- Customers
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
@nntoan
nntoan / full_reindex.php
Created March 23, 2016 07:37 — forked from antoinekociuba/full_reindex.php
Magento full reindex script (EE compatible)
<?php
/** Full reindex script */
/**
* @var array
*/
$processes = array();
/**
* @var Mage_Core_Model_Factory $factory
@nntoan
nntoan / disable_enable_ee_index.php
Created March 23, 2016 07:37 — forked from antoinekociuba/disable_enable_ee_index.php
Disable/Enable EE index updates (might be useful during a script execution to speed it up...)
<?php
/**********************
****** DISABLE *******
**********************/
/** var Mage_Core_Model_Config $config */
$config = Mage::app()->getConfig();
/**
@nntoan
nntoan / update_emails.sql
Created March 23, 2016 07:38 — forked from antoinekociuba/update_emails.sql
Update customer/order email addresses in test environment database (prevent to accidentally send test emails to real customers)
## Update order email addresses ##
UPDATE `sales_flat_order`
SET `customer_email` = CONCAT('test__', `customer_email`)
WHERE `customer_email` NOT IN ('email@domain.com', 'email2@domain.com')
AND `customer_email` NOT LIKE 'test__%';
## Update customer email addresses ##
UPDATE `customer_entity`
SET `email` = CONCAT('test__', `email`)
WHERE `email` NOT IN ('email@domain.com', 'email2@domain.com')