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
View dosya_zaman.py
import os
(mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) = os.stat("dosya.py")
# bu çok tercih edilmez. bir de daha karışık
####### ya da #########
a = os.path.getmtime("foo.py")
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.
View tomcat_killer.sh
#!/bin/bash
ps -A | grep tomcat | awk '$4 !~ /grep/ {print $1}' | xargs kill -9
View logback-logger-off.md

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" />
</logger>

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

View pkg_resources-DistributionNotFound-six.md

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/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
View maven-war-exclude-directory.md

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.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration>
View primefaces-dataexport-column-display-none.md

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) {
Array.prototype.push.call(arr, e);
callback(arr);
};
};
var array = [1,2,3];
eventify(array, function(newArray) {
View logging-urlmappings-in-grails.md

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

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