Skip to content

Instantly share code, notes, and snippets.

View rawaludin's full-sized avatar
:octocat:
Fix stuff

Rahmat Awaludin rawaludin

:octocat:
Fix stuff
View GitHub Profile
@rawaludin
rawaludin / Ubuntu: Bash daily command
Created October 28, 2012 11:43
Usefull daily bash command
Usefull bash command
Resize Image >>
convert -resize 50% source.png dest.jpg
convert -resize 1024X768 source.png dest.jpg
Compress jpeg
jpegoptim *.JPG –max=50
@rawaludin
rawaludin / gist:4103884
Created November 18, 2012 06:32
jquery: toTop watcher
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery(document).ready(function($) {
$(window).scroll(function() {
if($(this).scrollTop() != 0) {
$("#toTop").fadeIn();
} else {
$("#toTop").fadeOut();
}
});
@rawaludin
rawaludin / gist:4110578
Created November 19, 2012 13:14
jquery : smooth scroll
$(document).ready(function() {
// animation of navigation
$(function() {
$('.nav-collapse .nav li a').bind('click',function(event){
var anchor = $(this);
$('html, body').stop().animate({
scrollTop: $(anchor.attr('href')).offset().top - $('.navbar-inner').height() - ($('.navbar-inner').height()/4.8)
}, 1500/*,'easeInOutExpo'*/);
class PabrikSepeda {
public static void main(String[] args) {
Sepeda ThrillAgent = new Sepeda();
ThrillAgent.merk = "Wim Cycle";
ThrillAgent.kecepatan = 0;
ThrillAgent.tambahKecepatan();
ThrillAgent.tambahKecepatan();
ThrillAgent.tambahKecepatan();
ThrillAgent.tambahKecepatan();
ThrillAgent.tambahKecepatan();
class Sepeda {
public int posisiGigi;
public int kecepatan;
public String merk;
Sepeda() {
this.posisiGigi = 3;
this.kecepatan = 20;
this.merk = "Polygon";
}
class PabrikSepeda2 {
public static void main(String[] args) {
Sepeda Dominate = new Sepeda();
Dominate.cetakKecepatan();
Sepeda RodaTiga = new Sepeda("Family", 100);
RodaTiga.cetakKecepatan();
}
}
@rawaludin
rawaludin / Burung.java
Last active December 12, 2015 10:29
belajar visibility
class Burung {
public int jmlSayap;
private int jmlKaki;
protected String jenis;
String warna;
public void setJmlKaki(int jumlah) {
this.jmlKaki = jumlah;
}
@rawaludin
rawaludin / TamanBurung.java
Created February 12, 2013 01:34
belajar visibility
class TamanBurung {
public static void main(String[] args) {
Burung Kakatua = new Burung();
// Ini akan berhasil
Kakatua.jmlSayap = 2;
System.out.println("Jumlah sayap kakatua: "+Kakatua.jmlSayap);
// Ini akan error, karena private
// Kakatua.jmlKaki = 2;
class Vertebrata {
public int tulangBelakang;
Vertebrata() {
this.tulangBelakang = 1;
}
public void jalanKaki() {
System.out.println("Hewan sedang berjalan...");
}
class Aves extends Vertebrata {
int sayap;
Aves() {
this.tulangBelakang = 30;
}
public void jalanKaki() {
System.out.println("Burung sedang berjalan...");
}