Skip to content

Instantly share code, notes, and snippets.

View hahn's full-sized avatar
🐅
aing maung

Hanhan Husna hahn

🐅
aing maung
View GitHub Profile
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@etiennestuder
etiennestuder / speak.gradle
Last active March 14, 2024 07:30
Voice notification when when Gradle build finishes (for Mac OS X)
// When runnning a Gradle build in the background, it is convenient to be notified immediately
// via voice once the build has finished - without having to actively switch windows to find out -
// and being told the actual exception in case of a build failure.
// Put this file into the folder ~/.gradle/init.d to enable the acoustic notifications for all builds
gradle.addBuildListener(new BuildAdapter() {
@Override
void buildFinished(BuildResult result) {
@tsuharesu
tsuharesu / AddCookiesInterceptor.java
Last active June 8, 2024 07:30
Handle Cookies easily with Retrofit/OkHttp
/**
* This interceptor put all the Cookies in Preferences in the Request.
* Your implementation on how to get the Preferences MAY VARY.
* <p>
* Created by tsuharesu on 4/1/15.
*/
public class AddCookiesInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
@martinusadyh
martinusadyh / SimpleCalc.js
Last active August 29, 2015 14:03
Implementasi Shunting-Yard Algorithm
// Implementasi custom calculator dengan menggunakan algoritma Shunting-Yard
// Referensi Algoritma : http://en.wikipedia.org/wiki/Shunting-yard_algorithm
// Contoh : http://www.chris-j.co.uk/parsing.php
// Custom calculator untuk melakukan conversi rumus menjadi nilai akhir
// @param String rumus: Informasi tentang rumus yang ingin dihitung.
// Contoh rumus adalah :
// - a+b*c
// - ((a+b)*c*d/(e+f))
// - a/b/c*d
@rdlester
rdlester / JpegGlitch.java
Created September 13, 2011 05:47 — forked from tily/JpegGlitch.java
glitch jpeg file in java
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Random;
//Changes: constants broken out of algorithm into variables for easy experimentation
class JpegGlitch2 {
public static final int TOGGLE = 3;