Skip to content

Instantly share code, notes, and snippets.

View widnyana's full-sized avatar
🤘
Open for opportunity :)

wid widnyana

🤘
Open for opportunity :)
View GitHub Profile
import java.lang.StringBuilder;
import java.util.Scanner;
public class ToRoman {
public static String toRomawi(int decimalNum)
{
if ( decimalNum < 0 || decimalNum > 3999 ) {
@widnyana
widnyana / _vimrc windows
Created June 15, 2014 17:53
vimrc for windows with vundle
set nocompatible
filetype off " required by Vundle
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
" begin vundle {
let path='F:\PLAYGROUND\APPS\Vim\vimfiles\bundle'
call vundle#begin(path)
" let Vundle manage Vundle, required
#!/usr/bin/env python
"""
Regex for URIs
These regex are directly derived from the collected ABNF in RFC3986
(except for DIGIT, ALPHA and HEXDIG, defined by RFC2234).
They should be processed with re.VERBOSE.
"""
"""
Celery base task aimed at longish-running jobs that return a result.
``AwesomeResultTask`` adds thundering herd avoidance, result caching, progress
reporting, error fallback and JSON encoding of results.
"""
from __future__ import division
import logging
import simplejson
@widnyana
widnyana / demo.py
Created August 18, 2015 08:34
Demonstrating Sebangsa OpenAPI
#!/usr/bin/env python
# -*- Coding: utf-8 -*-
from json import dumps
from urllib import urlencode, unquote
from urlparse import urlparse, parse_qsl, ParseResult
from requests_oauthlib import OAuth1Session
base_url = "put base url here"
@widnyana
widnyana / sample.py
Created September 21, 2015 05:47
python header example
__author__ = "Rob Knight, Gavin Huttley, and Peter Maxwell"
__copyright__ = "Copyright 2007, The Cogent Project"
__credits__ = ["Rob Knight", "Peter Maxwell", "Gavin Huttley",
"Matthew Wakefield"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "Rob Knight"
__email__ = "rob@spot.colorado.edu"
__status__ = "Production"
@widnyana
widnyana / dump-jne.json
Last active October 3, 2015 15:11
list dump kota-kode jne
[{"code": "KDR10000", "name": "KEDIRI"}, {"code": "KOE10000", "name": "KUPANG"}, {"code": "AMI10000", "name": "MATARAM"}, {"code": "AMQ10000", "name": "AMBON"}, {"code": "BDJ10000", "name": "BANJARMASIN"}, {"code": "BDO10000", "name": "BANDUNG"}, {"code": "BKI10000", "name": "BEKASI"}, {"code": "BKS10000", "name": "BENGKULU"}, {"code": "BOO10000", "name": "BOGOR"}, {"code": "BPN10000", "name": "BALIKPAPAN"}, {"code": "BTG10000", "name": "BONTANG"}, {"code": "BTJ10000", "name": "BANDAACEH"}, {"code": "MJK10000", "name": "MOJOKERTO"}, {"code": "MXG10000", "name": "MALANG"}, {"code": "SUB10000", "name": "SURABAYA"}, {"code": "TGR10000", "name": "TANGERANG"}, {"code": "PBL10000", "name": "PROBOLINGGO"}, {"code": "PDG10000", "name": "PADANG"}, {"code": "PDN10000", "name": "PANDAAN"}, {"code": "TNJ10000", "name": "TANJUNGPINANG"}, {"code": "TRK10000", "name": "TARAKAN"}, {"code": "TTE10000", "name": "TERNATE"}, {"code": "UPG10000", "name": "MAKASAR"}, {"code": "SMI10000", "name": "SUKABUMI"}, {"code": "SOC10000", "
@widnyana
widnyana / init.sh
Last active October 19, 2015 11:02
golang workspace initiator
#!/usr/bin/env bash
# widnyana - Noisegate Labs.
echo "Creating workspace layout for base Golang Project..."
# ===
read -p ">>> Enter new Foldername to store your project: " dirname
read -p ">>> Enter the url package will reside: " pkgurl
# ===========================================
echo ">>> Creating dir..."
@widnyana
widnyana / main.py
Created November 12, 2015 04:35
a noobs attempt to ansvia codetalent.
'''
Copyright (C) 2015 Ansvia, Pt.
#Code challenge goal:
Ekstrak nama-nama user yang diawali dengan karakter `@` seperti pada text berikut :
```
hi @budi kamu tahu dimana si @agus? Tadi dia di sini sama @marta.cantik
```
@widnyana
widnyana / pipelines.py
Last active November 23, 2015 06:57 — forked from tzermias/pipelines.py
Scrapy MySQL pipeline.Just a mirror to the asynchronous MySQL pipeline.Copy-paste it directly to pipelines.py. Database credentials are stored in settings.py. Based on http://snipplr.com/view/66986/
import MySQLdb.cursors
from twisted.enterprise import adbapi
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
from scrapy.utils.project import get_project_settings
from scrapy import log
SETTINGS = get_project_settings()