Skip to content

Instantly share code, notes, and snippets.

View veysiertekin's full-sized avatar

Veysi Ertekin veysiertekin

View GitHub Profile
@veysiertekin
veysiertekin / center.css
Last active August 29, 2015 13:57
Cross Browser element centralization either vertical and hozirontal (also support ie 7) .
.vacA {display:table; height: 100%; width:100%; position: relative;}
.vacB {*position: absolute; top: 50%; display: table-cell; vertical-align: middle;}
.vacC {*position: relative; top: -50%;}
@veysiertekin
veysiertekin / FindEncoding.java
Created April 3, 2014 22:38
Determine encoding from byte array or any input stream.
/*
* Download "UniversalDetector" from here: https://code.google.com/p/juniversalchardet/
*/
public class FindEncoding {
private FindEncoding(){}
public static String findEncoding(byte[] bytes) {
UniversalDetector detector = new UniversalDetector(null);
detector.handleData(bytes, 0, bytes.length);
@veysiertekin
veysiertekin / .gtkrc-2.0
Last active August 29, 2015 14:01
Best Gtk configuration for Eclipse [clean view] ( ~/.gtkrc-2.0 )
style "gtkcompact" {
font_name="Sans 9"
GtkButton::default_border={0,0,0,0}
GtkButton::default_outside_border={0,0,0,0}
GtkButtonBox::child_min_width=0
GtkButtonBox::child_min_heigth=0
GtkButtonBox::child_internal_pad_x=0
GtkButtonBox::child_internal_pad_y=0
GtkMenu::vertical-padding=1
GtkMenuBar::internal_padding=0
@veysiertekin
veysiertekin / JBossLoginKeygen.java
Created July 16, 2014 11:43
Password keygen for jboss "login-config.xml" file.
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.SecretKeySpec;
@veysiertekin
veysiertekin / tips.txt
Created December 1, 2014 08:16
axis tips
http://www.nsftools.com/stubby/ApacheAxisClientTips.htm
# Neo4j Documentation
# http://neo4j.com/docs/stable/preface.html
# start graph server
neo4j start
# import from `sql` file
# note: be sure that neo4j started
neo4j-shell -file <path-to-file>
@veysiertekin
veysiertekin / apache-httpd-changes.sh
Last active August 29, 2015 14:14
Apache2 configs for local test [inc. PHP]
# File path:
# /etc/apache2/httpd.conf # in mac: /private/etc/apache2/httpd.conf
...
# Enable `php` module
LoadModule php5_module libexec/apache2/libphp5.so
...
...
# Add or change ServerName
# Generate entities with specific namespace
php cli-config.php orm:convert-mapping --namespace='Entity\' --force --from-database annotation library/
# ... and generate setter/getter methods
php cli-config.php orm:generate-entities library/ --generate-annotations=true
# Note!!!
# If you want to generate only one table add `filter` parameter!
php cli-config.php orm:convert-mapping --namespace='Entity\' --force --from-database annotation library/ --filter="<table-name>"
# Generate tables in DB via classes
@veysiertekin
veysiertekin / db.create.user.js
Last active February 10, 2016 08:21
Mongo DB - usefull tricks
// select db
use test;
// create a user with db role(s) (http://docs.mongodb.org/manual/reference/built-in-roles/)
db.createUser( { user: "test", pwd: "changeit", roles: [ { role: "dbOwner", db: "test" } ] } );
@veysiertekin
veysiertekin / spring-client.java
Created June 17, 2016 08:44
simple hazelcast dojos
import com.hazelcast.client.HazelcastClient;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.spring.cache.HazelcastCacheManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration