Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@danyaljj
danyaljj / convertTSV2CSV.py
Created June 25, 2015 22:13
Convert TSV file to CSV file in Python
import os
import csv
import sys
csv.field_size_limit(sys.maxsize)
for fn in os.listdir('.'):
print( os.path.splitext(fn) )
print( os.path.splitext(fn)[1] == ".tsv" )
if os.path.isfile(fn):
@danyaljj
danyaljj / screen.md
Created June 25, 2015 23:00
Screen commands

screen -S NAME Start a new screen

CTRL+A d Detach (while inside screen)

screen -d SCREENIDDetach screen in another terminal

screen -dr Connect to screen and detach others (to remember: "screen doctor!")

exit Terminate screen

@danyaljj
danyaljj / reactJS_generalForm.jsx
Created June 25, 2015 23:02
The general structure of a reactJS program (ES5)
React.createClass({
propTypes: {},
mixins : [],
getInitialState: function() {},
getDefaultProps: function() {},
componentWillMount : function() {},
componentWillReceiveProps: function() {},
var style = {
backgroundColor: 'red',
}
var Hello = React.createClass({
render: function() {
//return <div>Hello {this.props.name}</div>;
return (
<table>
<tr>
@danyaljj
danyaljj / sbt.txt
Last active August 29, 2015 14:23
General notes on SBT
SBT
==============
* Default body:
name := "projecta"
version := "0.1.0-SNAPSHOT"
organization := "com.github.myname"
scalaVersion := "2.10.3"
@danyaljj
danyaljj / runJava.sh
Created June 25, 2015 23:12
Sample script for java
#!/bin/bash
JAVA=java
LIBDIR=lib
CP=bin
for file in `ls $LIBDIR`; do
CP=$CP:$LIBDIR/$file
done
@danyaljj
danyaljj / scala.txt
Created June 26, 2015 00:27
Scala summary
== Scala notes
== main function:
def main(args: Array[String]) {
println("Hello, world!")
}
== looping
@danyaljj
danyaljj / maven.txt
Created June 26, 2015 00:28
Maven summary
* Output as jar:
<packaging>jar</packaging>
* Comment:
<!-- Output to jar format -->
* (Create stanfalone package with dependencies )[http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven]
* Show tree of dependencies
mvn dependency:tree
@danyaljj
danyaljj / git.md
Created June 26, 2015 00:29
Git summary

Git

  • Unstaging (undo the file after adding it):

git reset FILENAME

  • untrack a file:

git rm --cached file_name

@danyaljj
danyaljj / fsharp.fs
Created June 26, 2015 00:30
Fsharp gist
// Random notes on F#
// Daniel Khashabi, June 2014
// References :
// http://learnxinyminutes.com/docs/fsharp/
// http://www.fincher.org/tips/Languages/fsharp.shtml
// http://fsharpforfunandprofit.com/
// http://en.wikibooks.org/wiki/F_Sharp_Programming
open System