Skip to content

Instantly share code, notes, and snippets.

@daohoangson
daohoangson / gist:2008244
Created March 9, 2012 19:32
com/android/phone/CallNotifier.java diff to enable on-call-state-changed vibration
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index 2e82543..0131c13 100755
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -160,6 +160,7 @@ public class CallNotifier extends Handler
private static final int TONE_RELATIVE_VOLUME_SIGNALINFO = 80;
private Call.State mPreviousCdmaCallState;
+ private Call.State mPreviousGsmCallState;
private boolean mVoicePrivacyState = false;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class SpellChecker {
public static String[] results;
public boolean loadRuleBase(String filename){
try{
<?php
$rawPostData = @file_get_contents('php://input');
if (!empty($rawPostData)) {
$json = @json_decode($rawPostData, true);
// do something with the json array
// example $json['email'], etc...
}
@daohoangson
daohoangson / cleaned.js
Last active May 11, 2019 12:17
Auto invite friends to Facebook group script -- Beautified from http://pastebin.com/qBJfuh3c using http://jsbeautifier.org/
jx = {
getHTTPObject: function () {
var e = !1;
if ("undefined" != typeof ActiveXObject) try {
e = new ActiveXObject("Msxml2.XMLHTTP")
} catch (t) {
try {
e = new ActiveXObject("Microsoft.XMLHTTP")
} catch (n) {
e = !1
@daohoangson
daohoangson / index.html
Created January 9, 2013 16:18
Test HTML gist
Hi!
@daohoangson
daohoangson / gist:5132085
Last active December 14, 2015 18:49
logcat filter for Android
tag:[^(Adreno200\-EGL|dalvikvm|IInputConnectionWrapper|OpenGLRenderer|SpannableStringBuilder|Trace)]
public function getFeaturedItems($nodeIds, $groupIds, $limitOption)
{
return $this->fetchAllKeyed($this->limitQueryResults(
'
SELECT thread.*, attachment.*, attachment_data.*
FROM xf_thread AS thread
LEFT JOIN xf_attachment AS attachment ON
(attachment.content_id = thread.first_post_id AND attachment.content_type = \'post\')
LEFT JOIN xf_attachment_data AS attachment_data ON
(attachment_data.data_id = attachment.data_id AND attachment_data.thumbnail_width > 0)
<?php
$arr_a = array('1','2','3','4','5','6');
$arr_b = array('apples','oranges','bananas','peaches');
function makeArray($array_a, $array_b) {
$newArr = $array_a;
foreach($array_b as $value)
{
$rand = rand(0, count($newArr) - 1);
@daohoangson
daohoangson / Post.php
Last active December 19, 2015 21:29 — forked from anonymous/Post.php
public function renderHtml()
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$this->_params['profilePost']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['profilePost'], $bbCodeParser, array());
}
[user]
name = Dao Hoang Son
email = daohoangson@gmail.com
[alias]
cp = cherry-pick
st = status -s
cl = clone
ci = commit
co = checkout