Skip to content

Instantly share code, notes, and snippets.

View sadra's full-sized avatar
👨‍💻
Developing new thing...

Sadra Amlashi sadra

👨‍💻
Developing new thing...
View GitHub Profile
@sadra
sadra / machine.js
Last active December 26, 2020 10:56
Generated by XState Viz: https://xstate.js.org/viz
const TimeMachine = Machine({
id: 'odinMachine',
initial: 'waitingForBuySignal',
context: {
profit: undefined,
buySignal: undefined,
entryOrder: undefined,
saviorOrders: [],
sellOrders: [],
@sadra
sadra / machine.js
Last active December 29, 2020 20:05
Generated by XState Viz: https://xstate.js.org/viz
const TimeMachine = Machine({
id: 'odinMachine',
initial: 'waitingForBuySignal',
context: {
profit: undefined,
buySignal: undefined,
entryOrder: undefined,
saviorOrders: [],
sellOrders: [],
@sadra
sadra / generate-ssh-key.sh
Created January 14, 2020 04:37 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
//
// AppDelegate.swift
//
// Created by Sadra on 11/18/17.
// Copyright © 2017 Fibernet. All rights reserved.
//
import UIKit
import CoreData
import Firebase
@sadra
sadra / Mom Promise in ES5.js
Last active November 26, 2017 21:11
Mom Promise to but new phone.
/* ES5 */
var isMomHappy = true;
// Promise
var willIGetNewPhone = new Promise(
function (resolve, reject) {
if (isMomHappy) {
var phone = {
brand: 'iPhone X',
color: 'gray'
@sadra
sadra / BadgeView.java
Last active April 23, 2018 06:36
Badge View with number or empty value
/*
*
* BadgeView.java
* BadgeView
*
* Copyright (c) 2017 Sadra Isapanah Amlashi.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.