Skip to content

Instantly share code, notes, and snippets.

from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import sys
import random
from math import cos, pi, sqrt
NPN = 32
NMESH = 50
DM = ((float) (1.0/(NMESH-1.0)))
class Kalkulator:
def __call__(self, fungsi, a, b):
if fungsi == 'tambah':
return self.tambah(a, b)
if fungsi == 'kurang':
return self.kurang(a, b)
if fungsi == 'kali':
return self.kali(a, b)
all : debversion
@fajran
fajran / Makefile
Created December 2, 2008 09:41
Cubes with OpenGL
CC = gcc -Wall
kubus: kubus.c
$(CC) kubus.c -o kubus -lGL -lGLU `sdl-config --cflags --libs`
@fajran
fajran / igv.py
Created December 5, 2008 08:34
Interactive Graph Visualization with Jython and Prefuse
from prefuse import *
from prefuse.render import *
from prefuse.action import *
from prefuse.action.assignment import *
from prefuse.action.layout import *
from prefuse.action.layout.graph import *
from prefuse.controls import *
from prefuse.visual import *
from prefuse.util import *
from prefuse.util.display import *
all : debversion
test : all
./runtest.sh
#include <osg/Matrix>
#include <osgViewer/Viewer>
#include <osg/Geode>
#include <osg/Shape>
#include <osg/ShapeDrawable>
#include <osg/Vec3>
using namespace osg;
using namespace osgViewer;
#include <openssl/hmac.h>
#include <openssl/sha.h>
#include <string.h>
#include <stdio.h>
inline char tohex(char c)
{
if ((c >= 0) && (c <= 9)) { return '0' + c; }
else { return 'a' + (c-10); }
}
_sedot_pkgs()
{
local cur prev opts base
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
pkgs=$(ls -d /mirror/sedot/pkgs/*/ | while read a; do basename $a; done)
COMPREPLY=($(compgen -W "${pkgs}" -- ${cur}))
return 0
@fajran
fajran / gist:68830
Created February 23, 2009 06:30
Mari joged
/*
* gambar ditulis di background: url()
* lebar (width) dan tinggi (height) disesuaikan lagi agar sesuai dg ukuran gambar
*
* cit ini sudah dites sukses di firefox 3.0.6, safari 3.2.1, dan opera 9.52
* ie? masih ada yg make ya? http://getfirefox.com sekarang juga!
*
*/
#dash-stats h3 {