Skip to content

Instantly share code, notes, and snippets.

View phra's full-sized avatar
💻
root@localhost ~#

Francesco Soncina phra

💻
root@localhost ~#
View GitHub Profile
#export PS1="\[\033[36m\][\D{%a %e:%b:%g %T}] \`if [ \$? = 0 ]; then echo -e '\e[01;32m:)'; else echo -e '\e[01;31m:('; fi\` \[\e[01;32m\]\u@\h:\[\e[01;34m\]\w\[\e[01;34m\]\$\[\e[00m\] "
export PS1="\[\033[36m\][\D{%a%e:%b:%g %T}] \[\e[01;32m\]\u@\h:\[\e[01;34m\]\w\[\e[01;34m\]\$\[\e[00m\] "
extract() {
while (($#)); do
case $1 in
-h|--help) exit 0 ;;
--) shift; break ;;
@phra
phra / preprocessor_fun.h
Created July 8, 2016 16:34 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@phra
phra / .vimrc
Created November 3, 2016 11:16
Vi iMproved config
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
" Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
"

Keybase proof

I hereby claim:

  • I am phra on github.
  • I am phra (https://keybase.io/phra) on keybase.
  • I have a public key whose fingerprint is B52F AC34 A07E B53F 340E 9854 91FF 93D1 B85D 76B5

To claim this, I am signing this object:

@phra
phra / fibonacci-generator.js
Created March 27, 2017 22:07 — forked from jfairbank/fibonacci-generator.js
Fibonacci ES6 Generator
function *fibonacci(n) {
const infinite = !n && n !== 0;
let current = 0;
let next = 1;
while (infinite || n--) {
yield current;
[current, next] = [next, current + next];
}
}
@phra
phra / typescript.txt
Last active July 16, 2017 22:12
cosa è typescript?
vedo che c'è parecchia confusione su typescript, a partire da cosa sia.
cercherò di fare chiarezza su cosa sia, a cosa serva e quali sono pro/contra di utilizzarlo:
typescript, come flow, nasce come type system INCREMENTALE per javascript, il che significa aggiungere dei metadati nel codice che possano essere consumati da qualcuno (tsc per ts e babel via plugin per flow) in modo da rendere fortemente tipato un linguaggio che lo è solo debolmente, senza però obbligare lo sviluppatore a tipare tutta la codebase prima di utilizzarlo ma favorendo anche un ingresso graduale in progetti pre-esistenti.
cosa è un tipo? semplicissimo:
- "stringa" -> string
- 42 -> number
un po' meno semplice:
@phra
phra / rinkeby_address.txt
Created August 1, 2017 13:16
rinkeby_address
0xec0F3e0d5880Eb5e80CaA5911fe5cCDe06763F2C
0x498bEA12b62aFCCF53B657f6fFD0B76544187307
0xec0F3e0d5880Eb5e80CaA5911fe5cCDe06763F2C
@phra
phra / EthereumDev.md
Created October 9, 2017 18:29 — forked from learner-long-life/EthereumDev.md
How to Set up an Ethereum Dev Environment

How to Set up an Ethereum Dev Environment

So you want to be an Ethereum developer! Congrats, much treasure awaits you. Developing Ethereum dapps benefits from having a well-crafted development environment. This can often be daunting to beginners, so I'm giving you my favorite dev environment to help get you started.

Once your code fortress is constructed, you'll be able to

  • Compile smart contracts written in Solidity