Skip to content

Instantly share code, notes, and snippets.

Yazin yazinsai

Block or report user

Report or block yazinsai

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yazinsai
yazinsai / Android-Emulator-on-AWS-EC2.md
Last active Jul 31, 2019 — forked from atyachin/Android-Emulator-on-AWS-EC2.txt
Installing and running Android Emulator on Amazon AWS EC2 (Ubuntu 16.04 / m5.xlarge)
View Android-Emulator-on-AWS-EC2.md

Getting the Android Emulator running on EC2 📱

# @ your EC2 instance
sudo apt update
sudo apt install openjdk-8-jre unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d android-sdk
sudo mv android-sdk /opt/
export ANDROID_SDK_ROOT=/opt/android-sdk
@yazinsai
yazinsai / dl
Last active May 19, 2019
Persistently run a process over SSH even if disconnected
View dl
#!/bin/sh
if test -t 1; then exec 1>/dev/null
fi
if test -t 2; then exec 2>/dev/null
fi
"$@" &
@yazinsai
yazinsai / slack_webhook_post.py
Last active May 8, 2019 — forked from devStepsize/slack_webhook_post.py
POST a JSON payload to a Slack Incoming Webhook using Python requests
View slack_webhook_post.py
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import requests
# Set the webhook_url to the one provided by Slack when you create the webhook at
View keybase.md

Keybase proof

I hereby claim:

  • I am yazinsai on github.
  • I am yazin (https://keybase.io/yazin) on keybase.
  • I have a public key whose fingerprint is 0D54 C43C 6D83 3AEE 0E44 32DE C193 119E 305E D218

To claim this, I am signing this object:

View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View arduino-esc-test.ino
/*
Coded by Marjan Olesch
Sketch from Insctructables.com
Open source - do what you want with this code!
*/
#include <Servo.h>
int PIN_ESC = 9, value = 0;
Servo srvESC;
@yazinsai
yazinsai / ImportJSON.gs
Created Apr 26, 2016
Get data from any API straight into your Google Sheets, effortlessly!
View ImportJSON.gs
/*====================================================================================================================================*
ImportJSON by Trevor Lohrbeer (@FastFedora)
====================================================================================================================================
Version: 1.2.1
Project Page: http://blog.fastfedora.com/projects/import-json
Copyright: (c) 2012-2013 by Trevor Lohrbeer
License: GNU General Public License, version 3 (GPL-3.0)
http://www.opensource.org/licenses/gpl-3.0.html
------------------------------------------------------------------------------------------------------------------------------------
A library for importing JSON feeds into Google spreadsheets. Functions include:
View gradient-descent-data.csv
32.502345269453031 31.70700584656992
53.426804033275019 68.77759598163891
61.530358025636438 62.562382297945803
47.475639634786098 71.546632233567777
59.813207869512318 87.230925133687393
55.142188413943821 78.211518270799232
52.211796692214001 79.64197304980874
39.299566694317065 59.171489321869508
48.10504169176825 75.331242297063056
52.550014442733818 71.300879886850353
View gradient-descent-example.py
# y = theta_1 * x + theta_0
# Not actually required in the gradient descent calculation; just used to verify
# the sanity of the results :)
def compute_error_for_line_given_points(theta_0, theta_1, points):
totalError = 0
for i in range(0, len(points)):
x = points[i, 0]
y = points[i, 1]
totalError += (y - (theta_1 * x + theta_0)) ** 2
return totalError / (2 * float(len(points)))
View customer-charge.php
<?php
// Setup Start object
require_once('./lib/Start.php');
Start::setApiKey("test_sec_k_e06df93760b388375e1f6");
// Get the customer ID (usually from your Database)
$customer_id = "cus_abc123def456ghi789";
// Charge the customer (can be done many times, over a period of time)
Start_Charge::create(array(
You can’t perform that action at this time.