Skip to content

Instantly share code, notes, and snippets.

Yohanes Nugroho yohanes

Block or report user

Report or block yohanes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View talk.html
<html>
<head>
<title>Talk</title>
<script src="jquery-3.3.1.min.js"></script>
</head>
<body>
Say
<form onsubmit="return say();">
<input type="text" style="font-size: 72pt; background: #eeeeee" id="t" size=30 >
</form>
View talk.php
<?php
header("Content-type: application/json");
$lang = "en";
$dir = "/var/www/html/talkdata/";
$text = $_GET['t'];
$m = urlencode($text);
$filename = $lang . "-". $m . ".mp3";
$file = $dir.$filename;
if (!file_exists($file)) {
$mp3 = file_get_contents(
@yohanes
yohanes / pidgey.py
Last active Sep 6, 2016
How many Pidgeys you need to reach an XP (assuming you always evolve after 12 candies and not using lucky egg)
View pidgey.py
import sys
if (len(sys.argv)<2):
print "Usage: python pidgey.py targetxp"
exit(0)
target_xp = int(sys.argv[1])
print "Target XP ", target_xp
View click_server.py
from flask import Flask, redirect, url_for
import os
app = Flask(__name__)
@app.route('/')
def index():
return """
<html><head><title>HDMI switcher</title><style>
.btn {
@yohanes
yohanes / click.py
Created Jan 28, 2016
Switch a button
View click.py
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
PIN=18
GPIO.setup(PIN, GPIO.OUT)
GPIO.output(PIN, 1)
time.sleep(0.1)
GPIO.output(PIN, 0)
GPIO.cleanup()
View keybase.md

Keybase proof

I hereby claim:

  • I am yohanes on github.
  • I am yohanes (https://keybase.io/yohanes) on keybase.
  • I have a public key whose fingerprint is 1095 F8DF 6A46 17E1 693E AAE6 338A 94F8 AC75 B7E0

To claim this, I am signing this object:

View cheryl.pl
% to run it: swipl -g 'conclusion' -t halt -q -s cheryl.pl
% http://www.straitstimes.com/news/singapore/education/story/primary-5-maths-question-goes-viral-stumps-adults-20150413
unique(A) :- aggregate_all(count, A, M), M==1.
birthday_list(15, may).
birthday_list(16, may).
birthday_list(19, may).
birthday_list(29, may).
@yohanes
yohanes / dalton.js
Created Oct 26, 2014
Dalton's Corporate Security Safe for Business
View dalton.js
<script>var a=c.getContext('2d');
var e=a.createLinearGradient(0,0,c.width,0);
var s=(3).toString(36);
e.addColorStop('0','#c53ec9');e.addColorStop('1.0','#b3baf3');
a.fillStyle=e;a.font='bold 12px verdana';a.fillText(s,22,19);
var s=(9).toString(36);var v=a.createLinearGradient(0,0,c.width,0);
v.addColorStop('0','#884431');v.addColorStop('1.0','#c33861');
a.fillStyle=v;a.font=' 12px Gerogia';a.fillText(s,70,15);
var e=a.createLinearGradient(0,0,c.width,0);e.addColorStop('0','#c4ec8c');
var n=/b/.source;e.addColorStop('1.0','#825952');a.fillStyle=e;
@yohanes
yohanes / solvedalton.py
Created Oct 26, 2014
Dalton's Corporate Security Safe for Business
View solvedalton.py
import requests
import subprocess
url = "https://wildwildweb.fluxfingers.net:1422/"
prescript = """
c = new Object();
var result=[]
mycontext = new Object();
mygradient = new Object();
mygradient.addColorStop = function() {}
@yohanes
yohanes / hidden.js
Created Oct 26, 2014
HACK.LU CTF 2014: HIDDEN IN PLAIN SIGHT
View hidden.js
var fs = require('fs')
var crypto = require('crypto')
var HMAC_SECRET = ''
for (var i=0; i<20; i++) {
HMAC_SΕCRET = HMAC_SECRET + (Math.random()+'').substr(2)
}
function hmac_sign(path) {
var hmac = crypto.createHmac('sha256', HMAC_SECRET)
You can’t perform that action at this time.