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 java.net.Socket | |
import rx.subscriptions.Subscriptions | |
import rx.lang.scala.Observable | |
import scala.concurrent.{Future, future} | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.util.{Failure, Success} | |
// A reactive parallel port scanner written with Rx.Java | |
// @author: @gousiosg, @headinthebox |
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
/* | |
* Github commits that are then tweeted. | |
* by @gousiosg, @headinthebox | |
*/ | |
void Main() | |
{ | |
var q = from ghinfo in PullRequestersInfo() | |
from u in ghinfo | |
from t in Tweets(u).TakeUntil(Observable.Timer(TimeSpan.FromMinutes(5))) | |
select new {User = u, Tweet = t}; |
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
select a.month, | |
a.total_commits - b.commits_from_pull_reqs as direct, | |
b.commits_from_pull_reqs as pullreq | |
from | |
(select strftime("%Y-%m-01", substr(c.created_at, 0, 20)) as month, | |
p.id as prid, count(c.id) as total_commits | |
from commits c, projects p, project_commits pc | |
where p.id = pc.project_id | |
and c.id = pc.commit_id | |
group by month, p.id) as a, |
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
<?php | |
class Triangle | |
{ | |
var $colors = array("yellowgreen", "tomato", "plum"); | |
var $vertices; | |
function Triangle($vertices) | |
{ | |
assert(sizeof($vertices) == 3); |
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
# Copyright (c) 2013 Georgios Gousios | |
# MIT-licensed | |
create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; | |
use stackoverflow; | |
create table badges ( | |
Id INT NOT NULL PRIMARY KEY, | |
UserId INT, |
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
server { | |
listen 80; | |
server_name nagios.tld.org; | |
access_log /var/log/nginx/nagios.access.log; | |
error_log /var/log/nginx/nagios.error.log info; | |
root /usr/share/nagios3/htdocs; | |
index index.php index.html; |
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
library(reshape) | |
library(ggplot2) | |
library(corrplot) | |
library(caret) | |
source('ml.R') | |
# Util stuff | |
load.filter <- function(path) { | |
setAs("character", "POSIXct", |
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
#First, install RVM as per https://rvm.io | |
rvm install 2.5.1 | |
rvm use 2.5.1 | |
git clone [email protected]:gousiosg/github-mirror.git | |
cp config.yaml.standalone config.yaml | |
# Install dependencies | |
gem install bundler |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'json' | |
require 'hue' | |
delft="http://www.buienradar.nl/Json/RainForecast3Hours?lat=52.006&lon=4.355&weatherstationid=6344&streetlevel=false" | |
percipitation = JSON.parse(open(delft).read)['forecasts'][1]["precipation"] |
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
#!/usr/bin/env ruby | |
# | |
require 'open-uri' | |
require 'json' | |
require 'pp' | |
require 'uri' | |
File.open('locs').each_line do |location| | |
url=URI.escape("http://nominatim.openstreetmap.org/search/#{location}?format=json&addressdetails=1") |
OlderNewer