Uno scrittoio digitale …

24 maggio 2016

msgpack

Archiviato in: code — Tag:, , , , — admin @ 09:18

It’s like JSON. but fast and small.

18 maggio 2016

Team organization

Archiviato in: Senza categoria — Tag:, , — admin @ 19:18

Kaizen
Ciclo_di_Deming
Lean_Organization

Spunti da approfondire per una buona gestione delle risorse all’interno di un tem.

6 maggio 2016

OpenSSL lib

Archiviato in: Senza categoria — Tag: — admin @ 10:03

un pò di casi d’uso di openssh lib … qua

4 maggio 2016

Prima scrittura di Lorenzo

Archiviato in: sapere è potere — admin @ 21:59

editor: nano
contenuto:
ouiwebfoued wrf
aeflj f wipef piwefbasdf
awdfasdfalsk fljasfasdfasd f
7wsdf7′asdnfals dfòasdbfaisdfasb df7asdf
asdfyasd fajs dgfffffjdhsdtdskdujdgh

yyyyyyyyyyyhhhhhhhhhhhhhhhhhhhhhhhh e4w4y
wsxz

Write ntfs from yosemite

Archiviato in: Senza categoria — Tag:, , — admin @ 17:01

suppose you have already installed homebrew

$> brew update
$> brew install Caskroom/cask/osxfuse
$> brew install homebrew/fuse/ntfs-3g

restart your mac … and the magic is done!

14 aprile 2016

Classic programmer paintings

Archiviato in: code — Tag:, — admin @ 14:03

http://classicprogrammerpaintings.tumblr.com/

30 marzo 2016

ebook search engine (and download)

Archiviato in: Senza categoria — Tag: — admin @ 18:04

http://it-ebooks-search.info/

8 gennaio 2016

ruby-debug gem

Archiviato in: rails — Tag:, — admin @ 19:00

guide

4 gennaio 2016

Attacking ruby on rails

Archiviato in: rails — Tag: — admin @ 19:10

http://www.phrack.org/papers/attacking_ruby_on_rails.html

4 dicembre 2015

tig, another front-end for git

Archiviato in: Senza categoria — Tag:, — admin @ 12:46

doc
tig-the-ncurses-front-end-to-git

available feature
> tree view
> blame
> search for commit messages
> see history of a certain file/path

3 dicembre 2015

Reverse-proxying web applications with nginx

Archiviato in: Senza categoria — Tag:, , — admin @ 23:58

Have nginx
> sudo apt-get install nginx

Define your nginx config, e.g. at /etc/nginx/conf.d/reverse-proxy.conf:

server {
  listen 127.0.0.1;

  location /foo/ {
    proxy_pass https://www.example.com/;
  }
}

Reload your config
> sudo service nginx reload
Done.

Visit http://localhost/foo/ and you’ll see results of https://www.example.com/.

INFO:
read this about reverse/forward proxy

11 agosto 2015

Full web stack No browser required

Archiviato in: Senza categoria — Tag:, , — admin @ 14:03

phantomjs

17 luglio 2015

js

Archiviato in: code, web — Tag:, — admin @ 22:55

to read …

promisejs
browserify
amcharts

25 giugno 2015

Simple decorator in ruby

Archiviato in: code — Tag:, , , — admin @ 15:15

require 'securerandom'

class EventQueue
  attr_accessor :messages

  def initialize
    @messages = []
  end

  def enqueue(event, args, state)
    @messages << [event, args, state]
  end
end

module Notifier
  def notify_on(event)
    guid = SecureRandom.uuid
    puts "#{guid} ==> #{event}"

    define_method("#{guid}") do |*args|
      @event_queue.enqueue(event, args, :start)
      begin
        result = __send__("#{guid}_#{event}", *args)
      ensure
        @event_queue.enqueue(event, args, :end)
      end
      result
    end

    alias_method "#{guid}_#{event}", event
    alias_method event, "#{guid}"
  end
end

class Store
  extend Notifier

  def initialize(event_queue)
    @event_queue = event_queue
  end

  def order_purchase(user, items)
    ## @event_queue.enqueue(__method__, [user, items], :start)
    do_stuff
    ## @event_queue.enqueue(__method__, [user, items], :end)
  end

  def decrease_inventory(items)
    ## @event_queue.enqueue(__method__, [items], :start)
    do_stuff
    ## @event_queue.enqueue(__method__, [items], :end)
  end

  notify_on :order_purchase
  notify_on :decrease_inventory      

  private

  def do_stuff
    puts "called from #{caller[0]}"
  end
end

puts "#" * 100
queue = EventQueue.new
store = Store.new(queue)
store.order_purchase("alan", ["book", "pen"])
puts "#" * 100
puts "messages = #{queue.messages.inspect}"
puts "#" * 100
puts Store.new(queue).methods.sort - Object.methods.sort

Output:

d02ad4da-a5ec-4ae8-b5ed-53845dd2b391 ==> order_purchase
56df2c28-b927-42d2-8e19-07d115b2c818 ==> decrease_inventory
####################################################################################################
called from /home/alan/Dropbox/clab/Aptana Studio 3 Workspace/2016-06-18/decorator.rb:188:in `d02ad4da-a5ec-4ae8-b5ed-53845dd2b391_order_purchase'
####################################################################################################
messages = [[:order_purchase, ["alan", ["book", "pen"]], :start], [:order_purchase, ["alan", ["book", "pen"]], :end]]
####################################################################################################
56df2c28-b927-42d2-8e19-07d115b2c818
56df2c28-b927-42d2-8e19-07d115b2c818_decrease_inventory
d02ad4da-a5ec-4ae8-b5ed-53845dd2b391
d02ad4da-a5ec-4ae8-b5ed-53845dd2b391_order_purchase
decrease_inventory
order_purchase


16 giugno 2015

Byteman

Archiviato in: code, java — Tag:, , — admin @ 20:59

Byteman is a byte code manipulation and injection tool kit. It allows us to intercept and replace arbitrary parts of Java code to make it behave differently or break it (on purpose):

> get all threads stuck in a certain place and let them continue at the same time (hello race condition)
> throw Exceptions at unexpected locations
> tracing through your code during execution
>change return values

and a lot more things.

Custom T-Shirt

Archiviato in: sapere è potere — Tag: — admin @ 20:54

http://www.cafepress.com/

21 maggio 2015

Appunti

Archiviato in: Senza categoria — admin @ 20:38

http://stackoverflow.com/questions/74674/how-to-do-i-check-cpu-and-memory-usage-in-java

http://www.vogella.com/tutorials/JavaPerformance/article.html

http://javatune.com/post.cfm/15-useful-performance-tools-for-java-environments

http://docs.oracle.com/javase/7/docs/platform/jvmti/jvmti.html

MapDB (java library)

Archiviato in: java — Tag:, , , — admin @ 20:24

MapDB is embedded database engine. It provides java collections backed by disk or memory database store. MapDB has excellent performance comparable to java.util.HashMap and other collections, but is not limited by GC. It is also very flexible engine with many storage backend, cache algorithms, and so on. And finally MapDB is pure-java single 400K JAR and only depends on JRE 6+ or Android 2.1+.

What for?
> In-memory cache with expiration based on time-to-live or maximal size, Redis or EZCache replacement
> Huge indexes
> Persistent data model
> Alternative memory model if you are limited by GC

6 maggio 2015

caniuse html5/css3 feature ?

Archiviato in: Senza categoria — Tag:, — admin @ 09:21

http://caniuse.com/

Grazie Giada D. :D

28 aprile 2015

Ninna nanna per Lorenzo

Archiviato in: Senza categoria — Tag: — admin @ 22:09

ninna nanna

Articoli precedenti »

Funziona con WordPress