This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('table').addClass('table table-hover course-list-table'); | |
var $t = $("table"); | |
if ($t.has("tbody")) $t.find("tbody").children().unwrap(); | |
$t.find("tr:first").wrap("<thead />").children('td').replaceWith(function(i, html) { | |
return '<th>' + html + '</th>'; | |
}); | |
$t.find("tr").not(":first").wrapAll("<tbody />"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////upload | |
$scope.httpMethod="POST"; | |
$scope.howToSend=1; | |
$scope.fileReaderSupported = window.FileReader != null; | |
$scope.uploadRightAway = true; | |
$scope.hasUploader = function(index,idx) { | |
return $scope.tmpstore[idx].upload[index] != null; | |
}; | |
$scope.abort = function(index,idx) { | |
$scope.tmpstore[idx].upload[index].abort(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function allitemap($date){ | |
header('Access-Control-Allow-Origin:*'); | |
ini_set('memory_limit','1000M'); | |
$alldata = $this->mod_detailaraccounting->get_allitemap($date)->result_array(); | |
$data['data'] = $alldata; | |
$data['filename'] = 'allitem-'.$date; | |
$data['array_header'] = array( | |
'GPART' => 'Partner', | |
'BU_NAME' => 'Nama OLO', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------ | |
# Desigining "trending topics in 24 hours sliding window" with Redis | |
# ------------------------------------------------------------------ | |
redis-cli del tophashes:2010-12-07-08-00 | |
redis-cli del tophashes:2010-12-07-09-00 | |
redis-cli del tophashes:current | |
echo '=== 8:00 AM ===' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.filter("timeago", function () { | |
//time: the time | |
//local: compared to what time? default: now | |
//raw: wheter you want in a format of "5 minutes ago", or "5 minutes" | |
return function (time, local, raw) { | |
if (!time) return "never"; | |
if (!local) { | |
(local = Date.now()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dependencies node.js | |
sudo aptitude install build-essential | |
sudo apt-get install libssl-dev | |
Install node.js & npm the correct way | |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://plus.google.com/103477952788636904712/posts/JetPwDUPiyC?pid=5849620255008294978&oid=103477952788636904712 | |
select rel_id from | |
( | |
select rel_id,count(rel_id) as id_count from keyword as b | |
where find_in_set(b.keyword,"komputer,laptop,intel") | |
group by rel_id | |
) as a where id_count = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: Redis connection to 127.0.0.1:6379 failed - read ECONNRESET | |
at RedisClient.on_error (/home/server/web/node_modules/redis/index.js:196:24) | |
at Socket.<anonymous> (/home/server/web/node_modules/redis/index.js:106:14) | |
at Socket.EventEmitter.emit (events.js:95:17) | |
at net.js:441:14 | |
at process._tickCallback (node.js:415:13) | |
Error: Ready check failed: Redis connection gone from close event. | |
at RedisClient.on_info_cmd (/home/server/web/node_modules/redis/index.js:380: | |
35) | |
at Command.callback (/home/server/web/node_modules/redis/index.js:430:14) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://forum.xda-developers.com/android/software/ultimate-guide-compile-android-kernel-t2871276 | |
http://forum.xda-developers.com/nexus-s/development/tutorial-how-to-compile-kernel-t1774035 | |
http://marcin.jabrzyk.eu/posts/2014/05/building-and-booting-nexus-5-kernel | |
install gapps iuni u3 | |
http://iuni-os.fr/viewtopic.php?f=9&t=4 | |
http://www.techniful.in/2013/03/porting-lewa-rom-to-any-devicenoobs.html | |
http://marcin.jabrzyk.eu/posts/2014/05/building-and-booting-nexus-5-kernel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$max = 10; | |
$arr = range(1,$max,3); | |
$arr2 = range(1,$max,2); | |
$arr = array_merge($arr,$arr2); | |
$res2 = array(); | |
foreach($arr as $key=>$val) { | |
$res2[$val] = true; | |
} | |
$res2 = array_keys($res2); |