Skip to content

Instantly share code, notes, and snippets.

View alinz's full-sized avatar
🎯
¯\_(ツ)_/¯

Ali Najafizadeh alinz

🎯
¯\_(ツ)_/¯
View GitHub Profile
@alinz
alinz / keybase.md
Created February 7, 2015 00:14
Keybase proof

Keybase proof

I hereby claim:

  • I am alinz on github.
  • I am alinz (https://keybase.io/alinz) on keybase.
  • I have a public key whose fingerprint is BDCE 86EA 7281 9C1E 6A4F F16E E75A 6615 3818 E8C6

To claim this, I am signing this object:

const fp_delta = () => {
let p = null;
return (v) => {
const t = p == null ? v : p;
p = v;
return v - t;
};
};
const fp_min = (min) => (v) => v < min? min : v;
@alinz
alinz / version-update.sh
Created March 18, 2016 18:20
Simple bash script to update your react-native version.
#!/bin/bash
usage ()
{
echo "Version Update"
echo ""
echo "Usage:"
echo ""
echo " Options:"
echo " -h show usage/help"
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTScrollView.h"
@alinz
alinz / certbot.md
Last active May 11, 2017 01:35
creating let's encrypt certificate using docker and certbot standalone
docker run -it --rm -p 443:443 -p 80:80 --name certbot -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/lib/letsencrypt:/var/lib/letsencrypt" certbot/certbot certonly
@alinz
alinz / dep.js
Last active November 16, 2017 20:02
Dependency Tracker for your app using babel
// @flow
// make sure to install `yarn add babel-preset-stage-0`
const fs = require('fs')
const path = require('path')
const { transform } = require('babel-core')
const walker = (inputPath, extension, list = []) => {
if (fs.statSync(inputPath).isFile()) {
@alinz
alinz / gundb-stresstest.js
Created December 5, 2017 17:03
Gundb Stress Test
const stream = require('stream')
const Gun = require('gun')
const randomString = length => {
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
let text = ''
for (var i = 0; i < length; i++) {
text += possible[Math.floor(Math.random() * possible.length)]
}
return text
@alinz
alinz / Dockerfile
Created December 13, 2017 21:46 — forked from nknapp/Dockerfile
Traefik setup as reverse-proxy with docker and letsencrypt
FROM traefik:camembert
ADD traefik.toml .
EXPOSE 80
EXPOSE 8080
EXPOSE 443
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCrdqehAKcyAltePmU4ULyAXfkeowGrx7RxKmbFO6VofdgCBKL4fRg74IaGqi6GuLuUSk9BD1UGOjiQ5OcZ7VQHZ+/eAZ8g6IWr+5T7diZCpAIz3d74zjVnEmk/PcLrNhRoLMvNn4pp7KJI0HX6OpJNI6VANn+a0+ASywwFep4eBy9Opw8sb1P9ppKlOZ6hHIX+CFqqRgfbEibpiv0+qZ0WQe2beIEA79fqrElTKNzpPuoWcbDsU/7SMg1DVZZM/RwswcOTnnDeh6SIdzb+zn1smveCceUmvC2+LVXm1i7HzjcUH+v/61+iGqpLhEBcjrcXVTbqRtGwo0Cuolt2TtrmCWXwL/diW8R74PkuAehOo/IcnQWRaYkpOh1gvyBuX2nhtubHrAQFLjjTZBpWaiB+LUb/3mnKeJirpLFzYpWE2Rfmsf1TNSCLq/Z42Yuvq3Xsu2y45iORQqp//Xt8Bhes/K6LjaVVpqmuOwujzxkHXDgszibU7TwNo0KaLUgL072f2Niz7KvJNwARwyR0MArXDsHolukfZErR1AWDijNmf7epJlrS2PF50lTP+5p4og1Cl4F/4VjkoaNBAVdEeI27SM2C+KBoJ+hkWgK+TKliwHHT7eAb3GevDb40gVHIsNwNSVzv1v708HL9Ai9YcQFqFmrj+j9xUr+PNefG/1Qt4w== a.najafizadeh@gmail.com
@alinz
alinz / styled.js
Last active February 24, 2018 17:48
Styled Component in React-Native
// @flow
import * as React from 'react'
import { View, Text, ScrollView, StyleSheet } from 'react-native'
const styled = (Component: React.ComponentType<any>) => (style: any = {}) => {
const container = StyleSheet.create({ container: style }).container
return (props: any = {}) => {
const { style, ...rest } = props
return <Component style={[container, style]} {...rest} />