Skip to content

Instantly share code, notes, and snippets.

View kamcpp's full-sized avatar
😖
{ x, { x, { x, ... } } }

Kam Amini kamcpp

😖
{ x, { x, { x, ... } } }
  • @ ActiveVideo
  • Amsterdam, Netherlands
View GitHub Profile
@kamcpp
kamcpp / gist:806143b6186f8922d315
Last active August 29, 2015 14:04
MySQL Commands
SELECT subgroupid, item_order, id, code, eduname, stdate, enddate, edudate, eduprice, edudiscount, completeness, shown, no_reg
FROM `tbleducation`
WHERE groupid =26 AND shown = 1
ORDER BY subgroupid, item_order
LIMIT 0 , 1000
-------------------------
SELECT id, eduname, description
FROM `tbleducation`
@kamcpp
kamcpp / useful-linux-commands
Last active August 29, 2015 14:05
Useful Linux Commands
Sorted list of directories consuming gigabytes of hard disk in [dir]:
du -h [dir] | grep '^[0-9,]\+G' | sort -nr
---------------------------------------------------------------------
@kamcpp
kamcpp / gist:f1c1d27995c6a4450053
Last active August 29, 2015 14:05
A sample hibernate persistence.xml file.
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="xyz">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>domain.Person</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>abc</servlet-name>
<servlet-class>web.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
@kamcpp
kamcpp / gist:74a39791c8819b9fce5a
Created September 9, 2014 07:28
Minimal Spring Beans XML
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd">
<bean id="bookDAO" class="co.karans.phonebook.web.domain.DefaultBookDAO" />
</beans>
SHA1 for '12345':
8cb2237d0679ca88db6464eac60da96345513964
@kamcpp
kamcpp / gist:213acc729637369c83f0
Created September 26, 2014 08:41
Maven and Nexus settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://[NEXUS_SERVER_ADDRESS]:8081/nexus/content/groups/public</url>
</mirror>
http://www.webometrics.info/en/asia/iran%20%28islamic%20republic%20of%29?sort=asc&order=World%20Rank
@kamcpp
kamcpp / TomEE-EJB-Remote-Invocation
Created November 2, 2014 09:33
TomEE-EJB-Remote-Invocation
import my_ejb_api.MyNumberGeneratorLocal;
import my_ejb_api.MyNumberGeneratorRemote;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Properties;
public class Test {
public static void main(String[] args) throws NamingException {
Properties p = new Properties();
@kamcpp
kamcpp / TomEE-EJB-Remote-Invocation-Dependencies
Created November 2, 2014 09:34
TomEE-EJB-Remote-Invocation-Dependencies
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-client</artifactId>
<version>4.7.1</version>
</dependency>