Skip to content

Instantly share code, notes, and snippets.

View tureki's full-sized avatar
🐢
(╯°□°)╯︵ ┻━┻

Kah Wai Liew tureki

🐢
(╯°□°)╯︵ ┻━┻
View GitHub Profile
@tureki
tureki / scws-install.sh
Created March 13, 2014 07:47
Linux SCWS install shell
#! /bin/sh
cd ~
mkdir build
cd build
wget http://www.xunsearch.com/scws/down/scws-1.2.2.tar.bz2
tar xvjf scws-1.2.2.tar.bz2
cd scws-1.2.2
./configure --prefix=/usr/local/scws ; make ; make install
cd /usr/local/scws/etc
wget http://www.xunsearch.com/scws/down/scws-dict-cht-utf8.tar.bz2
@tureki
tureki / lsyncd.conf
Created March 12, 2014 11:55
AWS EC2 lsyncd install and basic rsync setting
----
-- User configuration file for lsyncd.
--
-- Simple example for default rsync, but executing moves through on the target.
--
-- For more examples, see /usr/share/doc/lsyncd*/examples/
--
-- sync{default.rsyncssh, source="/var/www/html", host="localhost", targetdir="/tmp/htmlcopy/"}
settings {
@tureki
tureki / ace-editor.html
Created March 12, 2014 11:50
ace-editor auto height
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Editor</title>
</head>
<body>
<pre id="editor" style="width:100%;height:400px;">function foo(items) {
var i;
@tureki
tureki / google-analytics-track-page-view.html
Last active August 29, 2015 13:56
Google Analytics dynamic track page view testing.
<html>
<head>
<title>Ga Testing</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="https://raw.github.com/twbs/bootstrap/master/dist/css/bootstrap.min.css">
</head>
<body style="width:800;margin:20 auto;">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
@tureki
tureki / AWSK.class.php
Created February 26, 2014 09:27
RAW Curl Post to AWS Kinesis with PHP
<?php
/*
POST / HTTP/1.1
Host: kinesis.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
@tureki
tureki / find-and-remove.sh
Created February 20, 2014 16:03
Linux find and remove files with one command
#!/bin/bash
find . -type f | grep nginx | xargs rm -v
@tureki
tureki / php-get-last-modified-file-in-folder.php
Created February 20, 2014 08:54
php get last modified file in folder
<?php
$str_path = '/PATH/';
$cls_rii = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator( $str_path ),
\RecursiveIteratorIterator::CHILD_FIRST
);
$ary_files = array();
@tureki
tureki / bootstrap-dropmenu-combobox.html
Last active August 29, 2015 13:56
bootstrap3 dropdown combobox
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">
<span label>menu</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="#">drop1</a>
<a href="#">drop2</a>
<a href="#">drop3</a>