This file contains 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
HTML | |
--------------------- | |
<div class="f1 hide"> | |
<form> | |
<input type="radio" name="c" value="f1" checked>f1 | |
<input type="radio" name="c" value="f2">f2<br /> | |
</form> | |
<p>Welcome to my form1</p> | |
</div> | |
<div class="f2 hide"> |
This file contains 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
String.prototype.isEmpty = function(){ | |
return (!this || 0 === this.length); | |
} | |
String.prototype.truncateUntilFirst = function(str){ | |
if(!str || !str.isEmpty()){ | |
return this; | |
} | |
if(this.isEmpty()){ |
This file contains 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
dd if=/var/local/file.tar.gz | ssh ${USER}@${DEST} "ssh ${USER}@{DEST2} 'cat > file2.tar.gz' | |
# On DEST2 | |
mv ~/file2.tar.gz /opt | |
gunzip -dc file2.tar.gz | tar -xvf - |
This file contains 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
if(typeof dmk === "undefined"){ | |
dmk = {}; | |
if(typeof dmk.oo === "undefined"){ | |
dmk.NameSpace = {}; | |
} | |
} | |
/** | |
* static method, | |
* assumes the name spaces {Arra} is in order, ie ["dmk", "dmk.namespace1"] |
This file contains 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
if(typeof dmk === "undefined"){ | |
dmk = {}; | |
if(typeof dmk.oo === "undefined"){ | |
dmk.oo = {}; | |
} | |
} | |
/** function constructor **/ | |
dmk.oo.Class1 = function(config){ | |
this.member1 = config.member1; |
This file contains 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
Component = Class.extend({ | |
// constructor | |
init: function(){ | |
this.message = "I'm a class member!"; | |
// on click | |
$("#myBtn").on("click", _.bind(this.callBack, this)); | |
}, | |
// call back |
This file contains 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
import org.codehaus.groovy.grails.commons.ApplicationHolder | |
class BootStrap { | |
def init = { servletContext -> | |
def filePath = "resources/loadme.txt" | |
def text = ApplicationHolder.application.parentContext.getResource("classpath:$filePath").inputStream.text | |
println "found text = $text" |
This file contains 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
fs = require 'fs' | |
{exec} = require 'child_process' | |
src = "src/main/webapp" | |
dest = "bin" | |
lessc = "lessc" | |
# clean | |
task 'clean', "Clean project build dir #{dest}", -> | |
console.log "Cleaning build directory #{dest}..." |
This file contains 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
cat log.txt | grep EXPRESSION | sed 's/.*EXPRESSION://g' - | more |
This file contains 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
package dmk.solr; | |
import java.io.File; | |
import java.io.FilenameFilter; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.UUID; |
OlderNewer