This file contains hidden or 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
function createIfChain(chain){ | |
let ifChain = {} // ifChain should has everything chain has, except 'else' property | |
for(let key in chain){ | |
if(key != 'else'){ | |
ifChain[key] = chain[key] | |
} | |
} | |
return ifChain | |
} |
This file contains hidden or 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
const childProcess = require('child_process') | |
console.time('testExecFilePHP') | |
childProcess.execFile('php', ['tests/programs/add.php', '5', '6'], function(err, stdout, stderr){ | |
console.timeEnd('testExecFilePHP') | |
}) | |
console.time('testExecPHP') | |
childProcess.exec('php tests/programs/add.php 5 6', function(err, stdout, stderr){ | |
console.timeEnd('testExecPHP') |
This file contains hidden or 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 | |
echo "hello world"; | |
echo "hello world"; |
This file contains hidden or 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
/* Instruksi: Buka tab baru, tekan ctrl + shift + i, klik tab "console", lalu copy-paste kan kode berikut */ | |
let kalimatKonyol = "Tono adalah programmer yang sempurna. Jika program buatan Tono salah, salahkan programnya, jangan salahkan Tono. Tono itu sempurna, tapi program buatan Tono tidak"; | |
window.alert("Contoh kalimat konyol: " + kalimatKonyol); | |
/* Contoh penggunaan regex di javascript: */ | |
kalimatKonyol = kalimatKonyol.replace(/program buatan Tono/g, 'saya').replace(/Tono/g, 'Agama saya').replace(/programmer/g, 'agama').replace(/program/g, 'saya'); | |
window.alert("Kalimat dengan pola yang sama: " + kalimatKonyol); | |
/* Apa yang bikin anda baper? */ |
This file contains hidden or 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 | |
/* Created on Mudawikawi's laptop on 2017 new year eve, to show you miracle */ | |
class Mutant{ | |
function __get($property) | |
{ | |
if($property == 'a') | |
{ | |
if(property_exists($this, 'get_a')) | |
{ |
This file contains hidden or 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
#include <iostream> | |
#include <math.h> | |
using namespace std; | |
int get_digit(int angka, int digit){ | |
int divider = 1; | |
for(int i=0; i<digit; i++){ | |
divider *= 10; | |
} |
This file contains hidden or 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
#!/usr/bin/env python | |
''' | |
Kanban + Pomodoro + Reminder | |
If you use linux please install sox first (sudo apt-get install sox) | |
You can use these formats in order to remind you of the tasks: | |
* Y:m:d H:M:S | |
* Y:m:d H:M | |
* everyday H:M[:S] | |
* every [monday|tuesday|wednesday|thursday|friday|saturday] H:M[:S] | |
* *:m:d H:M[:S] |
This file contains hidden or 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
" Vim color file - gosolarized | |
" Generated by http://bytefluent.com/vivify 2016-08-03 | |
set background=dark | |
if version > 580 | |
hi clear | |
if exists("syntax_on") | |
syntax reset | |
endif | |
endif |
This file contains hidden or 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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* Description of Manage_purchase_invoice | |
* | |
* @author No-CMS Module Generator | |
*/ | |
class Manage_purchase_invoice extends CMS_CRUD_Controller { | |
protected $URL_MAP = array(); |
This file contains hidden or 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
Uses sysutils; | |
type | |
integer_array = array of integer; | |
integer_array_2d = array of integer_array; | |
var | |
closed_row, openned_row, closed_col, openned_col : integer_array; | |
map, previous_rows, previous_cols, fs, gs : integer_array_2d; | |
height, width, row, col, current_row, current_col, start_row, end_row, start_col, end_col, up_row, bottom_row, left_col, right_col, f, g, h, i, best_f, prev_row, prev_col, counter : integer; | |
solution_found : boolean; |