Skip to content

Instantly share code, notes, and snippets.

View fake-or-dead's full-sized avatar

fake-or-dead fake-or-dead

  • Thailand
  • 15:19 (UTC +07:00)
View GitHub Profile
### Keybase proof
I hereby claim:
* I am fake-or-dead on github.
* I am fake_or_dead (https://keybase.io/fake_or_dead) on keybase.
* I have a public key ASB364T21PGDbWi6B3_ar-UcVBRf8pqxDHKOHke3fAmzhwo
To claim this, I am signing this object:
@fake-or-dead
fake-or-dead / script
Last active September 10, 2015 16:38
playboy gallery
# download gallery thanks playboy cdn :D
curl http://playboy.co.th/cdn/image/\[0000-9999\] -O
# filter out playboy logo
find . -size 26155c -delete
find . -size 37091c -delete
# rename file to .jpg
find . -name '????' -exec bash -c 'mv $0 $0.jpeg' {} \;
dynos, apis = {}, {}
dyno, method, api, connect, service = '','','','',''
File.open('sample.log', "r") do |file|
file.each_line do |line|
# regular from this http://rubular.com/r/uwuiKelesS
target_api = /(method=GET path=\/api\/users\/\d+\/(count_pending_messages|get_messages|get_friends_progress|get_friends_score))|(method=(GET|POST) path=\/api\/users\/\d+ )/
next unless line.match(target_api)
line.split(': ')[1].split(' ').each do |methods|
k,v = methods.split('=')
@fake-or-dead
fake-or-dead / tesseract.rb
Created July 27, 2015 20:41
tesseract ocr with training
require "formula"
class Tesseract < Formula
desc "OCR (Optical Character Recognition) engine"
homepage "https://github.com/tesseract-ocr/"
url "https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz"
sha1 "a950acf7b75cf851de2de787e9abb62c58ca1827"
revision 3
bottle do

Kind of continue from the other gist how to install LAMP on an Amazon AMI

##Install git

sudo yum install git-core

##Create ssh directory since it doesn't exists by default on the Amazon AMI

@fake-or-dead
fake-or-dead / facebook.js
Created December 14, 2012 08:06 — forked from anonymous/facebook.js
Fork for accident create this gist in anonymous name
(function($) {
console.log("facebook loading...");
var j;
// check facebook available
if($('#fb-root').length === 0) {
// not found fb-root prepend element to body
$('body').prepend("<div id='fb-root'></div>");
// and load javascript for facebook
j = document.createElement('script');
j.type = 'text/javascript';
@fake-or-dead
fake-or-dead / ci_result_array_transform.php
Created August 19, 2012 07:08
CI transform database re-arrange result to be array("value1", "value2")
// re-arrange result to be array("value1", "value2")
$options = array("");
foreach ($query->result_array() as $key => $value) {
array_push($options, $value['field_name']);
}
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@fake-or-dead
fake-or-dead / gist:2156176
Created March 22, 2012 04:58 — forked from atroche/gist:1322143
Facebook Beautified
if (!window.FB) window.FB = {
_apiKey: null,
_session: null,
_userStatus: "unknown",
_logging: true,
_inCanvas: window.location.search.indexOf("fb_sig_in_iframe=1") > -1 || window.location.search.indexOf("session=") > -1 || window.location.search.indexOf("signed_request=") > -1 || window.name.indexOf("iframe_canvas") > -1 || window.name.indexOf("app_runner") > -1,
_https: window.name.indexOf("_fb_https") > -1,
_domain: {
api: "https://api.facebook.com/",
api_read: "https://api-read.facebook.com/",
@fake-or-dead
fake-or-dead / gist:2156175
Created March 22, 2012 04:58 — forked from atroche/gist:1322143
Facebook Beautified
if (!window.FB) window.FB = {
_apiKey: null,
_session: null,
_userStatus: "unknown",
_logging: true,
_inCanvas: window.location.search.indexOf("fb_sig_in_iframe=1") > -1 || window.location.search.indexOf("session=") > -1 || window.location.search.indexOf("signed_request=") > -1 || window.name.indexOf("iframe_canvas") > -1 || window.name.indexOf("app_runner") > -1,
_https: window.name.indexOf("_fb_https") > -1,
_domain: {
api: "https://api.facebook.com/",
api_read: "https://api-read.facebook.com/",