This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# switch to the jenkins user | |
[root@li220-252:~] su jenkins | |
jenkins@li220-252:/root$ | |
# Move into the jenkins directory | |
jenkins@li220-252:~$ cd /var/lib/jenkins/ | |
# Intialize a git repository | |
jenkins@li220-252:~$ git init | |
Initialized empty Git repository in /var/lib/jenkins/.git/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CSS Color Names | |
// Compiled by @bobspace. | |
// | |
// A javascript array containing all of the color names listed in the CSS Spec. | |
// The full list can be found here: http://www.w3schools.com/cssref/css_colornames.asp | |
// Use it as you please, 'cuz you can't, like, own a color, man. | |
var CSS_COLOR_NAMES = ["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","Darkorange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var employees=[]; | |
employees[0]={name:"George", age:32, retiredate:"March 12, 2014"}; | |
employees[1]={name:"Edward", age:17, retiredate:"June 2, 2023"}; | |
employees[2]={name:"Christine", age:58, retiredate:"December 20, 2036"}; | |
employees[3]={name:"Sarah", age:62, retiredate:"April 30, 2020"}; | |
// sort by employee age | |
employees.sort(function(a, b){ | |
return a.age-b.age | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var cache = {}; | |
this.tmpl = function tmpl(str, data){ | |
// Figure out if we're getting a template, or if we need to | |
// load the template - and be sure to cache the result. | |
var fn = !/\W/.test(str) ? | |
cache[str] = cache[str] || | |
tmpl(document.getElementById(str).innerHTML) : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var first = $('div').attr('class').replace(/^(\S*).*/, '$1'); | |
var second = $('div').attr('class').split(' ')[0]; | |
var third = $('div').attr('class').split(' ').shift(); | |
var ArrayData = $.map($('div').attr('class').split(' '), function(value){ | |
return value; | |
}); | |
var thirdFirst = $('div').attr('class').split(' ').pop(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Protect window.console method calls, e.g. console is not defined on IE | |
* unless dev tools are open, and IE doesn't define console.debug | |
*/ | |
(function(exports) { | |
if (!exports.console) exports.console = {}; | |
// union of Chrome, FF, IE, and Safari console methods | |
var m = [ | |
"log", "info", "warn", "error", "debug", "trace", "dir", "group", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('textarea').val().replace(/\n/g, '<br />'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 한글포함 문자열 길이를 구한다 | |
*/ | |
function getTextLength(str) { | |
var len = 0; | |
for (var i = 0; i < str.length; i++) { | |
if (escape(str.charAt(i)).length == 6) { | |
len++; | |
} | |
len++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup({ | |
error: function(jqXHR, exception) { | |
if (jqXHR.status === 0) { | |
alert('Not connect.\n Verify Network.'); | |
} else if (jqXHR.status == 404) { | |
alert('Requested page not found. [404]'); | |
} else if (jqXHR.status == 500) { | |
alert('Internal Server Error [500].'); | |
} else if (exception === 'parsererror') { | |
alert('Requested JSON parse failed.'); |
NewerOlder