Skip to content

Instantly share code, notes, and snippets.


pooya parsa pi0

View GitHub Profile
pi0 / ResumeCreator.js
Last active Jun 28, 2018 — forked from farzadso/No mutations at all
This is what I call clean coding
View ResumeCreator.js
import assert from 'assert';
updateStepFourProps(type, operation, id) {
assert(Array.isArray(this.state[type]), `Cannot do operation on type '${type}'`)
switch (operation) {
case 'add':
[type]: this.state[type].concat(id)
pi0 / lodash.get.js
Last active Feb 1, 2018 — forked from harish2704/lodash.get.js
Simple lodash.get function in javascript
View lodash.get.js
* getProp - Simple lodash.get implementation
* @author @harish2704, @muffypl, @pi0
* @param {Object} object
* @param {String|Array} path
* @param {*} defaultVal
function getProp (object, path, defaultVal) {
const _path = Array.isArray(path)
? path
  • The benchmarks used by Marko, with one benchmark containing only a single component with ~50 lines of code, and the other 3 components with one of them fully static markup, are typical micro-benchmarks created to the advantage of certain implementation details. They are too isolated and too trivial to justify across-the-board performance claims.

  • For client-side performance I recommend using the 3rd party js-framework-benchmark as a more neutral reference; the benchmark tests a much bigger workload and covering a much more comprehensive performance scenarios. According to the data from the latest round Vue actually outperforms Marko. That said, even this benchmark doesn't reflect real world performance where much more overhead comes from big component trees.

  • Vue has significantly improved SSR performance for

pi0 /
Created Jun 13, 2017 — forked from znck/
Create an alias for last command.
function aliasthat {
if [ -n ${1} ]; then
fc -e "sed -i -e \"s/^.*/echo alias $1=\\\"'\\\"\'&\'\\\"'\\\" >> ~\/.bash_alias/\""
. ~/.bash_alias
View count.js
// $ yarn add request request-promise
// $ node count userA userB
const request = require('request-promise')
const get = resource => request({
url: /^https/.test(resource) ? resource : `${resource}`,
headers: {
'User-Agent': 'GitHub Contrib Counter',
'Authorization': 'token YOUR_PERSONAL_ACCESS_TOKEN'
View simple-sync-posix-hexdumper.c
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
pi0 /
Created Dec 18, 2016 — forked from joyrexus/
Form/file uploads with hapi.js

Demo of multipart form/file uploading with hapi.js.


npm install
npm run setup
npm run server

Then ...

pi0 / GitHub protocol
Created Nov 29, 2016 — forked from grawity/GitHub protocol
A comparison of protocols offered by GitHub (for #git on Freenode).
View GitHub protocol

Primary differences between SSH and HTTPS. This post is specifically about accessing Git repositories on GitHub.

Protocols to choose from when cloning:

plain Git, aka git://

  • Does not add security beyond what Git itself provides. The server is not verified.

    If you clone a repository over git://, you should check if the latest commit's hash is correct.

View Modelsim Altra - Ubuntu
#TODO : install to /opt ...
sudo dpkg --add-architecture i386
sudo apt-get update
View cake_helper_code_completion.php
* CakePHP Helper Code Completion
* @author junichi11
* install NetBeans 7.0 && cakephp-netbeans plugin
* /path/to/yourproject/nbproject/cake_helper_code_completion.php