Skip to content

Instantly share code, notes, and snippets.

View skuro's full-sized avatar

Carlo Sciolla skuro

View GitHub Profile
Name User ID Title Member ID Location Joined Group on Last visited group on Last Attended Total RSVPs RSVPed Yes RSVPed Maybe RSVPed No Meetups attended No shows Intro Photo Assistant Organizer Mailing List URL of Member Profile
. user 41998572 41998572 Amsterdam 07/09/2012 11/03/2016 03/11/2015 7 7 0 0 7 0 Yes Yes No Yes https://www.meetup.com/The-Amsterdam-Clojure-Meetup-Group/members/41998572/
_NB_ user 224228034 224228034 Singapore 04/12/2017 08/31/2017 06/14/2017 1 1 0 0 1 0 No Yes No Yes https://www.meetup.com/The-Amsterdam-Clojure-Meetup-Group/members/224228034/
Abbas user 187493013 187493013 Amsterdam 01/02/2017 03/12/2018 01/11/2017 1 1 0 0 1 0 No Yes No Yes https://www.meetup.com/The-Amsterdam-Clojure-Meetup-Group/members/187493013/
abdulkafi abdulsamad user 185216023 185216023 Amsterdam 03/13/2015 08/09/2016 0 0 0 0 0 0 No Yes No Yes https://www.meetup.com/The-Amsterdam-Clojure-Meetup-Group/members/185216023/
Abhishek Dubey user 231758544 231758544 Amsterdam 07/13/2017 07/13/2017 0
@skuro
skuro / website.cljs
Created November 5, 2017 15:38
Sample code from the Clojurebridge session #2
(ns nightcoders.removeme
(:require [reagent.core :as r]
[quil.core :as q]))
(enable-console-print!)
(def image-url
"https://i.pinimg.com/originals/96/cc/3a/96cc3aafba195cecfc2662acc405c699.gif")
(def clojurebridge-url
@skuro
skuro / property.py
Last active October 25, 2017 13:18
Using a property object
class Book:
def __init__(self, title, author):
self.title = title
self.author = author
def getShortDescription(self):
"""The getter for the shortDescription property"""
return self.title + ' was written by ' + self.author
@skuro
skuro / trapped_water.clj
Last active September 11, 2017 09:37
Clojure version of the water trapped between towers problem
(defn trapped-water [towers]
(let [maxes #(reductions max %) ; the seq of increasing max values found in the input seq
maxl (maxes towers) ; the seq of max heights to the left of each tower
maxr (reverse (maxes (reverse towers))) ; the seq of max heights to the right of each tower
mins (map min maxl maxr)] ; minimum highest surrounding tower per position
(reduce + (map - mins towers)))) ; sum up the trapped water per position
;; in the following, # is a tower block and ~ is trapped water:
;;
;; 10|
@skuro
skuro / tree.py
Created August 30, 2017 09:41
comments
class TreeNode:
def __init__(self, key, val, left=None, right=None, parent=None):
# key e' inutile
self.key = key
self.payload = val
self.leftChild = left
self.rightChild = right
self.parent = parent
def hasLeftChild(self):
class Node:
def __init__(self, cargo, next=None):
self.cargo = cargo
self.next = next
def __str__(self):
return str(self.cargo)
def search(self, needle):
>>> import datetime
>>> "oggi e' %s" % datetime.date.today()
"oggi e' 2017-05-04"
>>> "oggi e' %r" % datetime.date.today()
"oggi e' datetime.date(2017, 5, 4)"
@skuro
skuro / README.md
Last active March 8, 2017 20:09 — forked from Gonzih/README.md
markov-chain-meetup-dojo
@skuro
skuro / gifcast.zsh
Created January 8, 2017 15:56
You need to have imagemagick and ffmpeg installed.
gifcast () {
mkdir /tmp/gifcast
ffmpeg -i "$@" -r 10 /tmp/gifcast/gifcast%05d.png
convert -layers Optimize /tmp/gifcast/gifcast*.png gifcast.gif
rm /tmp/gifcast/gifcast*.png
rmdir /tmp/gifcast
}
(ns nono.core
(:import [javax.imageio ImageIO]
[java.io File]))
(def test-path "/Users/not-going-to-show-my-user/Downloads/sample.bmp")
(defn extract-rgb [pixel]
(let [r (bit-and 0x000000FF (bit-shift-right pixel 16))
g (bit-and 0x000000FF (bit-shift-right pixel 8))
b (bit-and 0x000000FF pixel)]