Skip to content

Instantly share code, notes, and snippets.

import sys
import cairo
import rsvg
def main():
fin = sys.argv[1]
fout = sys.argv[2]
svg = rsvg.Handle(file=fin)
width = svg.props.width
@fajran
fajran / better-google-reader-new-look.css
Created November 1, 2011 14:34
Google Reader New Look (FIXED)
#top-bar {
height: 40px;
}
#search {
padding: 5px;
}
#lhn-add-subscription-section, #viewer-header {
height: 40px;
@fajran
fajran / a.py
Created December 15, 2011 09:39
def angka():
return 10
print angka()
@fajran
fajran / index.php
Created March 13, 2012 13:37
Referer
<pre>
File: <?=basename($_SERVER['SCRIPT_FILENAME']);?>
Referer: <?=$_SERVER['HTTP_REFERER'];?>
Lanjut: <a href="index.php">index.php</a>
<a href="a.php">a.php</a>
<a href="b.php">b.php</a>
<script type="text/javascript">
function compute() {
var a = $('#value_a')[0].value;
var b = $('#value_b')[0].value;
$.ajax({
url: '/compute/?a=' + a + '&b=' + b,
success: function(data) {
$('#result').html(data);
}
import sys
import pyproj
extents = 122115.0, 485775.0 # lower left coordinate of science park map
cellsize = 5, 5 # cell size of science park map
src = pyproj.Proj(proj='latlong',datum='WGS84') # regular GPS coordinate system (used in google maps)
dst = pyproj.Proj(init='EPSG:28992') # coordinate system of NL/science park map
@fajran
fajran / .gitignore
Created September 7, 2012 08:38
Pertemuan 1 - Python - UVT
*.swp
* Now talking on #uvt
* Topic for #uvt is: "Diskusi Kelompok Program Python 2012"
* Topic for #uvt set by basic123 at Fri Sep 14 14:50:54 2012
-ChanServ- [#uvt] "Selamat Datang di Kelas UVT"
* #uvt :http://www.uvt.web.id
* fr4w4_ has quit (Quit: Page closed)
* basic123 (~pythonuni@111.94.107.157) has joined #uvt
* ChanServ gives channel operator status to basic123
<basic123> wah, belum pada datang ya
<basic123> Pak fajran: assalamualaikum
@fajran
fajran / blogger-to-wordpress.py
Last active August 21, 2016 16:28
A Blogger's backup file to WordPress' WXR converter. Only tested with posts and comments, and NOT with pages. May not be efficient for huge blogs since the script keep all content in the memory during conversion. Released as public domain.
# Blogger's backup file to WordPress' WXR converter.
#
# Only tested with posts and comments, and NOT with pages.
# May not be efficient for huge blogs since the script keep
# all content in the memory during conversion.
#
# Released as public domain.
#
# Please note that I converted the labels in Blogspot
# as tags in WordPress. I also hardcoded two categories for the
@fajran
fajran / M4.java
Last active December 18, 2015 03:29
Himpunan unik di Scala
public class M4 {
private int posisi;
private String asamAmino;
public M4(int posisi, String asamAmino) {
this.posisi = posisi;
this.asamAmino = asamAmino;
}
public int getPosisi() {