I hereby claim:
- I am altamic on github.
- I am altamic (https://keybase.io/altamic) on keybase.
- I have a public key ASDy9j3AgLBSjJNaMELFUHSoo73UsnjBAlhkxyOpdAVyrwo
To claim this, I am signing this object:
// | |
// StateMachine.swift | |
// | |
// Created by Michelangelo Altamore on 12/04/2018. | |
// Copyright © 2018 Michelangelo Altamore. All rights reserved. | |
// | |
import Foundation | |
protocol StateMachineInternals: class { |
#include <iostream> | |
// This is a rewrite of the technique showed here: | |
// http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html | |
// https://gist.github.com/dabrahams/1528856 | |
// Generate a static data member of type Stub::type in which to store | |
// the address of a private member. It is crucial that Stub does not | |
// depend on the /value/ of the the stored address in any way so that | |
// we can access it from ordinary code without directly touching |
# activate adb wifi connecting to a LAN device by IP | |
function adb-wifi { | |
if [ -z "$1" ] | |
then | |
echo "Usage:\nadb-wifi <device-ip>" | |
return 1 | |
fi | |
ADB_WIFI_TCP_PORT=5555 | |
adb tcpip $ADB_WIFI_TCP_PORT | |
adb connect "$1":$ADB_WIFI_TCP_PORT |
#!/usr/bin/env sh | |
# bitdump.sh | |
# | |
# captures Bitcoin network traffic | |
SELF=`basename $0` | |
if [[ $1 = "" ]]; then | |
DEFAULT="en1" |
# | |
# Ruby Example of the 'proof of work' explanation | |
# from https://en.bitcoin.it/wiki/Proof_of_work | |
# | |
# note: block data passed to do_work is simplified. | |
# bitcoin blockchain is more complex too. | |
# | |
require 'digest/sha2' |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
# Example implementation of wc -l | |
(ARGV.length == 0 ? | |
[["", STDIN]] : | |
ARGV.lazy.map { |file_name| | |
[file_name, File.open(file_name)] | |
}) | |
.map { |file_name, file| |
If you agree with the above principle, you are encouraged to adopt measures so that a such conduct can be effectively applied in your environment.
If you are a developer, be ready to point out (perhaps in writing) that you are willing to take full responsibility of your code and for this reason you are expected in some situation (i.e. insufficient technical experience, insufficient aptitude, etc.) to proclaim the impossibility to deliver code for ethical reasons conflicting with the principle. Reciprocally, you should have the right to know the position of each member of your team about the principle.
> Array.prototype.toObject = function() {b={}; for(i=0;i<this.length;i+=2) {b[this[i]]=this[i+1]}; return b;} | |
[Function] | |
> ["chiave1","valore1","chiave2","valore2"].toObject() | |
{ chiave1: 'valore1', chiave2: 'valore2' } |
class Hash | |
def to_xml | |
case keys.size | |
when 0 | |
"" | |
when 1 | |
result = nil | |
each_pair do |k, v| | |
case v | |
when nil then result = "<#{k.to_s}/>" |