Skip to content

Instantly share code, notes, and snippets.

@siniusxcode
siniusxcode / alert.js
Created February 8, 2012 02:48
javascript alert
alert('hello world');
@siniusxcode
siniusxcode / org.nginx.nginx.plist
Created December 14, 2012 02:16
org.nginx.nginx.plist
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>nginx</string>
<key>Program</key>
<string>/usr/local/sbin/nginx</string>
<key>KeepAlive</key>
<true/>
<key>NetworkState</key>
@siniusxcode
siniusxcode / jetty.xml
Created December 14, 2012 04:46
add forwarded config to connector in jetty.xml
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="forwarded">true</Set>
@siniusxcode
siniusxcode / block_request.js
Created December 18, 2012 05:47
blocking request with jQuery.ajax()
$(document).ready(function() {
$('#foo').bind('click', function() {
doSomething();
});
});
var doSomething = function(){
$('#foo').unbind('click');
$.ajax({
@siniusxcode
siniusxcode / gist:4343095
Created December 20, 2012 05:02
myBatis if error
<if test=”stringValue == ‘Y’”>
AND A.COLUMN1 = #{condition}
</if>
@siniusxcode
siniusxcode / gist:4343098
Created December 20, 2012 05:04
char to int
char y = 'Y';
int code = (int)y; // code에는 Y의 코드값인 89가 저장된다.
@siniusxcode
siniusxcode / gist:4343100
Created December 20, 2012 05:05
myBatis if
<if test='stringValue == "Y"'>
AND A.COLUMN1 = #{condition}
</if>
@siniusxcode
siniusxcode / .bash_profile
Created December 28, 2012 05:36
.bash_profile for Mac
# PATH
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
# Prompt
PS1='[\u \W]\$ '
# Prompt Color
export CLICOLOR=1
export TERM=xterm-color
export LSCOLORS=FxGxbxfxhxgxexhbabdxDx
@siniusxcode
siniusxcode / tns_names.ora
Created January 21, 2013 06:56
tns_names.ora
TEST_DB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
(CONNECT_DATA = (SID = sidName)(SERVER = serverName))
)
import cx_Oracle
connection = cx_Oracle.connect("ID", "PASSWORD", cx_Oracle.makedsn("HOST", 1521, "SID"))
cursor = connection.cursor()
cursor.execute("select count(*) from test_table");
print cursor.fetchall()
cursor.close()
connection.close()