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 example | |
import java.util.Date | |
object IdeOverview { | |
/* | |
* Basic stuff: | |
* | |
* - double shift - access to everything | |
* - cmd + shift + a - access to commands |
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
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/gojkic/.oh-my-zsh | |
ZSH_THEME="robbyrussell" | |
plugins=(git brew vagrant docker tmux) | |
# User configuration | |
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/.rvm/bin" | |
export HOMEBREW_CASK_OPTS="--appdir=/Applications" |
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
// Fire up that repl! | |
// You can't mix apple and oranges | |
var orange: String = "nice sweet orange" | |
var apple: Int = 10 | |
orange = apple // error: type mismatch | |
// You should keep info about the type all the time | |
var oranges: List[String] = List("sweet 1", "sweet 2") | |
var apple: Int = 10 |
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
#!/bin/bash | |
while getopts ":i:o:s:" opt; do | |
case $opt in | |
s) | |
ss=$OPTARG | |
;; | |
i) | |
input=$OPTARG | |
;; |
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.jooq.impl.TableImpl | |
import org.jooq.Record | |
object InsertInto { | |
// This enables you to write inserts like this | |
// Tables.USER_TABLE.save(userRecord) | |
implicit class EnhancedTableImpl[T <: Record](val table: TableImpl[T]) extends AnyVal { | |
def save(record: T)(implicit context: DSLContext) = { | |
val fields = record.fields().toSeq | |
context |
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
var ko = require('knockout'); | |
ko.components.register('simple-name', require('./simple-name.js')); | |
ko.applyBindings({ userName: ko.observable() }); |
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
#!/bin/bash | |
#------------------------------------------------------------------------------ | |
# Name: sbt-template.sh | |
# Purpose: Create an SBT project directory structure | |
# Usage: project=foo ./sbt-template.sh | |
#------------------------------------------------------------------------------ | |
set -e | |
if [ -d "${project}" ]; then | |
echo "ERROR: Directory with specified ${project} name exist." |
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
Function.prototype.method = function (name, func) { | |
this.prototype[name] = func; | |
return this; | |
}; | |
String.method('trim', function () { | |
return this.replace(/^\s+|\s+$/g, ''); | |
}); |
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
function EventTarget() { | |
this._listeners = {}; | |
} | |
EventTarget.prototype = { | |
constructor: EventTarget, | |
addListener: function(type, listener){ | |
if (typeof this._listeners[type] == "undefined"){ |
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
desc 'Stop rails server' | |
task :stop do | |
File.new("tmp/pids/server.pid").tap { |f| Process.kill 9, f.read.to_i }.delete | |
end | |
desc 'Starts rails server' | |
task :start do | |
Process.exec("rails s puma -d") | |
end |
NewerOlder