Skip to content

Instantly share code, notes, and snippets.

View goldalworming's full-sized avatar

arief nur andono goldalworming

View GitHub Profile
@goldalworming
goldalworming / jquery-wysiwygtabletotpl.js
Created August 31, 2014 04:46
jquery mengubah table standar dari wysiwyg agar memilki header dan class
$(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 />");
});
@goldalworming
goldalworming / incontroller.js
Created September 15, 2014 07:54
multiple upload angular.js controller
//////////////////////////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();
@goldalworming
goldalworming / controllers-converter.php
Created September 24, 2014 07:17
php download to excel
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',
# ------------------------------------------------------------------
# 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 ==='
.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())
}
@goldalworming
goldalworming / install-xmpp
Created October 21, 2014 08:29
install xmpp
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
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;
@goldalworming
goldalworming / errorredis.log
Created January 22, 2015 06:37
redis error
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)
@goldalworming
goldalworming / url.txt
Last active August 29, 2015 14:14
url
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
@goldalworming
goldalworming / mergearray.php
Created February 17, 2015 04:53
merge 2 array (not sorted)
<?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);