Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rosado on github.
  • I am rosado (https://keybase.io/rosado) on keybase.
  • I have a public key whose fingerprint is 70E6 0F2B D879 CA54 2276 AD93 9132 23FC 95B2 52C3

To claim this, I am signing this object:

@rosado
rosado / database.cmd
Created December 9, 2014 20:05
after installing postgres on windows from a zip file, this can be handy
@echo off
if "%1" == init (
bin\initdb -U postgres -A password -E utf8 -W -D data
)
if "%1" == "start" (
"bin\pg_ctl" -D "data" -l log\pgsql.log start
)
if "%1" == "stop" (
"bin\pg_ctl" -D "data" -l log\pgsql.log stop
@rosado
rosado / install-sources
Created January 19, 2015 14:12
install sources for current maven project
mvn dependency:sources -Dmaven.test.skip=true
@rosado
rosado / install-java8.sh
Created March 11, 2015 13:33
install-java8-on-xubuntu
#!/bin/bash
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
@rosado
rosado / .gitconfig
Created March 16, 2015 23:29
git aliases
[alias]
st = status
mlog = log --oneline --author=szabla
log1 = log --oneline
diffstat = diff --stat -r
br = branch
gwc = whatchanged -p --abbrev-commit --pretty=medium
@rosado
rosado / Channels (almost like in Newsqueak).md
Created July 27, 2015 18:30
Channels (almost like in Newsqueak) again

(published May 24, 2010, blog no longer exists)

Years ago I saw a really good talk by Rob Pike about a little known language called Newsqueak. I can’t remember if I had anything more than a mild interest in concurrent programming, but that talk got my attention. I read all I could find about concurrency in Newsqueak. Fun ideas are fun to play with.

I wrote a short article about channels, which are Newsqueak’s construct for synchronization between threads. I tried to emulate behavior of channels in C# via locking and signaling. I was aware that there probably is no 1:1 mapping between what Newsqueak calls processes and managed threads in .NET (though I’m not sure to this day how many processes could Newsqueak spawn before bringing machine to a halt) but the exercise was fun enough to do it anyway.

Now, this was long enough ago, that C# didn’t have syntax for lambdas and was

;; boids
;; a Clojure+Processing example
;;
;; written around Dec 2008/Jan 2009
;;
;; The code is in the Public Domain.
;;
;; based on Flocking example by by Daniel Shiffman
;; (distributed with processing)
;;
;; mutable boids
;; a Clojure+Processing example
;;
;; written around July/August 2009
;;
;; The code is in the Public Domain.
;;
;; based on Flocking example by by Daniel Shiffman
;; (distributed with processing)
;;
function get-libs(){
if(test-path "lib"){
$jars = (ls lib -include *.jar -recur) | foreach { $_.FullName }
if($jars){
[String]::Join(";", $jars)
}
}
}
$VERSION="1.0.0-SNAPSHOT"
$git_repo_location = (get-location).Path
function Prompt () {
$location = $git_repo_location
$id = 1
$historyItem = Get-History -Count 1
if($historyItem)
{
$id = $historyItem.Id + 1
}