Skip to content

Instantly share code, notes, and snippets.

View Keda87's full-sized avatar
:shipit:
Hmmmm

Adiyat Mubarak Keda87

:shipit:
Hmmmm
View GitHub Profile
@Keda87
Keda87 / JSONParser
Created December 25, 2013 05:03
GET data from internet / api
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
public class JSONParser {
public static String getPlainJSON(String api) throws MalformedURLException, IOException {
@Keda87
Keda87 / BCrypt.java
Last active July 27, 2016 09:33
BCrypt class to perform Bcrypt hashing
package PBO.other.generate.unique.id;
// Copyright (c) 2006 Damien Miller <djm@mindrot.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@Keda87
Keda87 / BufferedReader
Created March 16, 2014 16:55
IO operation with Java
package PBO.IO.Reader;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ReaderTest {
@Keda87
Keda87 / BinaryComplement
Created June 13, 2014 07:03
Veritrans apply CV test
package other.veritrans;
import java.util.Scanner;
import java.util.logging.Logger;
/**
* @author : Adiyat Mubarak
* @email : adiyatmubarak@gmail.com
* @blog : www.keda87.wordpress.com
*/
LAPORAN DAFTAR PELUNASAN KOLETKOR
AGEN PT. ARTIVISI INTERMEDIA
=====================================================================================================================
KODE KOLEKTOR : 0001
NAMA KOLEKTOR : JOJO
+------+--------------+---------------------------+---------+-------------+-------------+-------------+-------------+
@Keda87
Keda87 / styles.less
Created January 26, 2016 12:01 — forked from geddski/styles.less
improve Atom editor git gutter
atom-text-editor::shadow {
.line-numbers{
padding-left: 4px !important;
}
.git-line-modified, .git-line-added{
margin-left: -4px;
padding-left: 2px !important;
opacity: .5
}
@Keda87
Keda87 / gist:1e4cc16f4fd700b7ad4c
Created March 3, 2016 16:09 — forked from evildmp/gist:3094281
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@Keda87
Keda87 / middlewares.py
Last active March 31, 2016 03:26
Bootstrap Django Pagination
class PagingMiddleware(object):
"""Middleware to detect current page within page pagination."""
def process_request(self, request):
if 'page' in request.GET:
try:
request.active_page = int(request.GET.get('page'))
except ValueError:
public class BinarySearchTree {
public static Node root;
public BinarySearchTree(){
this.root = null;
}
public boolean find(int id){
Node current = root;
while(current!=null){
if(current.data==id){
@Keda87
Keda87 / rent_statistics.py
Created July 27, 2016 09:30
Django Template Filter for Humanize Day
"""
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2016 Adiyat Mubarak <adiyatmubarak@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.