Instantly share code, notes, and snippets.

Batuhan Bayrakci baybatu

View GitHub Profile
View gist:2884901
Bunun için iki adım gereklidir.
1. Konsolun yazı tipini TrueType bir yazı tipine çevirmek gerekir. Lucida Console ya da Consolas olabilir.
2. chcp 1254 komutu ile kod sayfasını değiştirmek
import os
(mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) = os.stat("")
# bu çok tercih edilmez. bir de daha karışık
####### ya da #########
a = os.path.getmtime("")
print type(a) # float
# 1340619312.918 gibi bir float sayı verir. Bunu okunabilir hale getirmek için time modülündeki ctime metodu kullanılabilir.
ps -A | grep tomcat | awk '$4 !~ /grep/ {print $1}' | xargs kill -9

When you need to tell Logback to stop logging for a logger, the following snippet can be added to logback.xml configuration file:

<logger name="loggerName">
    <level value="off" />

"loggerName" represents your logger name that will be stopped.


Today i have decided to write some unit test on JavaScript via Jasmine, but i encountered the following exception stack trace.

Traceback (most recent call last):
  File "/usr/local/bin/jasmine", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/", line 2603, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/", line 666, in require

packagingExcludes configuration tag can be used to exclude certain files or directories from the war file. It is important to put '/' character at the end of the directory to be excluded. If there is no such '/' character, then the entry is interpreted as a regular file.


The talented DataExporter component of the PrimeFaces can be used to export data listed in DataTable to various file formats, such as xls, pdf, csv and xml. Also, exportable attribute of column component inside of DataTable, can be used to determine to whether the column is exported to file or not. Well, what if we want to export a column without displaying on DataTable? In this case, we can add:

display: none;
View get-domain-mapping-in-grails.groovy
class Person {
Long id
String name
static mapping = {
table name: 'PERSON'
id column: 'PRS_ID'
name column: 'PRS_NAME'
View attach-listener-to-push-method.js
var eventify = function(arr, callback) {
arr.push = function(e) {, e);
var array = [1,2,3];
eventify(array, function(newArray) {

Add following log configuration into log4j block in Config.groovy.

all 'org.codehaus.groovy.grails.web.mapping'