Skip to content

Instantly share code, notes, and snippets.

View nunenuh's full-sized avatar
🏠
Working remotely from home

Lalu Erfandi Maula Yusnu nunenuh

🏠
Working remotely from home
View GitHub Profile
@nunenuh
nunenuh / SeventSegment.c
Created July 16, 2015 09:22
Sevent Segment
int A = 8;
int B = 9;
int C = 2;
int D = 3;
int E = 4;
int F = 5;
int G = 6;
void zero(){
@nunenuh
nunenuh / LEDFunction.c
Created July 16, 2015 08:22
Led pake Fungsi
int led1 = 2;
int led2 = 3;
int led3 = 4;
int led4 = 5;
int led5 = 6;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
@nunenuh
nunenuh / a2dissite
Created July 1, 2015 15:49
Python A2 Enable Site (a2ensite) And Disable Site (a2dissite) for CentOS 7
#!/usr/bin/env python
import sys
import os
arg = sys.argv
arlen = len(arg)
available = '/etc/httpd/sites-available'
enabled = '/etc/httpd/sites-enabled'
@nunenuh
nunenuh / 1.tutorial_nio_tap.txt
Last active August 29, 2015 14:21
GNS3 NIO TAP
# install requirement packet
sudo apt-get install uml-utilities
sudo apt-get install bridge-utils
# copy tap_active.sh ke bin
cp tap_active.sh /bin/tap_active.sh
# ubah file di /etc/rc.local dengan file rc.local yang ada pada gist ini
# jalankan perintah ini pada terminal
@nunenuh
nunenuh / gist:686d8f8315091043c263
Created April 17, 2015 18:31
HIBERNATE UTIL BARU
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package epsetupserv.orm.utils;
import epsetupserv.config.GeneralConfigurator;
import java.io.File;
import java.io.FileInputStream;
import java.util.Iterator;
import epserv.orm.utils.HibernateUtil;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
import orm.entity.Subdomain;
/**
*
@nunenuh
nunenuh / HibernateUtil.java
Created April 17, 2015 16:55
HibernateUtil.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package epserv.orm.utils;
import java.io.File;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.SessionFactory;
@nunenuh
nunenuh / gist:3c3841d4a6b1fe052b4c
Created April 17, 2015 08:47
Join Many to Many
SELECT
*
FROM book b
INNER JOIN book_has_category bhc
ON b.id = bhc.book_id
INNER JOIN category c
ON bhc.category_id = c.id
public void insert(Mahasiswa mhs){
String sql = "INSERT INTO mahasiswa (NIM, NAMA) VALUES(?,?)";
MySQLQuery query = new MySQLQuery();
PreparedStatement st = query.prepareQuery(sql);
st.setString(1, mhs.getNIM());
st.setString(2, mhs.getNAMA());
st.executeUpdate();
}
@nunenuh
nunenuh / gist:e3dd92f1626cccfe7728
Created March 26, 2015 08:49
sample table model
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package epcust.domain.subdomain;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import javax.swing.table.AbstractTableModel;
import orm.entity.Subdomain;