Skip to content

Instantly share code, notes, and snippets.

Trimikha Valentius tvalentius

View GitHub Profile
View reduce.js
var bali = [
{ regency:'Jembrana', population:114863 },
{ regency:'Tabanan', population:209308 },
{ regency:'Badung', population:277536 },
{ regency:'Gianyar', population:208443 },
{ regency:'Klungkung', population:79233 },
{ regency:'Bangli', population:106166 },
{ regency:'Karangasem', population:193787 },
{ regency:'Buleleng', population:294418 },
{ regency:'Denpasar', population:403292 }
View map.js
var bilanganDesimal = [1,2,3,4,5];
var bilanganBiner = bilanganDesimal.map( (element) => {
return element.toString(2);
})
console.log(bilanganBiner); // ["1", "10", "11", "100", "101"]
View filter.js
var arrayBaru = array.filter(function(element, i, array) {
return (element % 2 === 0);
});
View traditionalLoop.js
for(var i = 0; i < array.length; i++) {
if( array[i] % 2 ) === 0 ) {
arrayBaru.push(array[i]);
}
}
View gist:68ec08900f8c2716cec82f7d0c23295d
0x8b2a39946e41f5a0e2935cc25cfcf66d249daa6e
View replyMessage.js
module.exports = {
'askingLocationForPlace':[
{
'message':'Coba deh ketik nama lokasi yang kamu cari',
'packageId':1,
'stickerId':2
},
{
'message':'Hai ###, ketik dulu nama lokasinya ya',
'packageId':2,
@tvalentius
tvalentius / .block
Last active Apr 25, 2018
HDI Indonesia Choropleth Map
View .block
border: no
license: MIT
@tvalentius
tvalentius / .block
Last active Jul 31, 2017
Provinces in Indonesia
View .block
border: no
license: MIT
@tvalentius
tvalentius / gist:11d6655347fb57ad3a14
Created May 9, 2014
Testing Laravel4 Facebook connect
View gist:11d6655347fb57ad3a14
<?php
class HomeController extends BaseController {
public function getIndex()
{
//model
You can’t perform that action at this time.