Skip to content

Instantly share code, notes, and snippets.

View chrome-console-load-jquery.js
var jq = document.createElement('script');
jq.src = "//";
!function () {
var script = document.createElement("script");
script.setAttribute("src", "//");
rajeshpv / int_sort.sql
Created Jul 18, 2014
Given a table with one int column with random int ordered, write a query to get sorted asc and desc, as 2 columns of output
View int_sort.sql
-- the idea here is to populate rownum after sorting is done
-- if sorting is done along with row num, it defeats the purpose
-- rowid, does not help, since it almost generates a hascode value like
with l_table as (
select measure_id from int_table order by 1 asc
), r_table as (
select measure_id from int_table order by 1 desc
View MyProject.scala
import sbt._
class MyProject(info: ProjectInfo) extends DefaultProject(info)
//with de.element34.sbteclipsify.Eclipsify
//with IdeaProject
lazy val hi = task { println("hi Task"); None }
View MyPlugins.scala
import sbt._
class MyPlugins(info: ProjectInfo) extends PluginDefinition(info)
val a = "org.markdownj" % "markdownj" % "0.3.0-1.0.2b4"
lazy val eclipsify = "de.element34" % "sbt-eclipsify" % "0.5.1"
val repo = "GH-pages repo" at ""
val idea = "com.github.mpeltonen" % "sbt-idea-plugin" % "0.1-SNAPSHOT"
View install-files
|-- ant
| `--
|-- best-jboss.tar
|-- eclipse
| |-- eclipse-jee-galileo-SR2-linux-gtk.tar.gz
| `-- eclipse-jee-helios-linux-gtk.tar
|-- idea
| |-- idea-902
| | `-- ideaIC-9.0.2.tar.gz
View do-clean-log
#find $logDir -type f -name '*.log' | xargs echo $1
shopt -s nullglob
for f in $(find $logDir -type f -name '*.log')
echo $f
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" $f > ${logDir}/temp.txt
cp ${logDir}/temp.txt $f
View do-script
givenDir=$(basename $PWD)
echo $givenDir
script -afq $logFile
View gist:498423
Task(typeTask:String, id:Int, parentProject:Int price:Float)
notice "p" means project
task for "t"
there can be n number of tasks below project
and parent of project id will be always zero
the list is ordered based on id field
View withpgp-output.txt
[info] Wrote /home/rxxxxxx/dev/scalatra/fileupload/target/scala_2.8.0/scalatra-fileupload_2.8.0-2.0.0-SNAPSHOT.pom
[info] == scalatra-fileupload / make-pom ==
[info] == scalatra-fileupload / deliver-local ==
[warn] [NOT FOUND ] org.scalatra#scalatra_2.8.0;2.0.0-SNAPSHOT!scalatra_2.8.0.pom.asc(asc) (0ms)
[warn] ==== local: tried
[warn] /home/rxxxxxx/.ivy2/local/org.scalatra/scalatra_2.8.0/2.0.0-SNAPSHOT/ascs/scalatra_2.8.0.pom.asc
[warn] [NOT FOUND ] org.scalatra#scalatra_2.8.0;2.0.0-SNAPSHOT!scalatra_2.8.0.jar.asc(asc) (0ms)
[warn] ==== local: tried
[warn] /home/rxxxxxx/.ivy2/local/org.scalatra/scalatra_2.8.0/2.0.0-SNAPSHOT/ascs/scalatra_2.8.0-javadoc.jar.asc
View gist:519274
Requesting /reports but only have Map(DELETE -> List(), POST -> List(WrappedArray(/flash-map/form), WrappedArray(/upload), WrappedArray(/login), WrappedArray(/post)), GET -> List(WrappedArray(/flash-map/result), WrappedArray(/flash-map/form), WrappedArray(/upload), WrappedArray(/scalate), WrappedArray(/), WrappedArray(/logout), WrappedArray(/login), WrappedArray(/form), WrappedArray(/date/:year/:month/:day)), PUT -> List())