Skip to content

Instantly share code, notes, and snippets.

View mkobar's full-sized avatar

mkobar mkobar

View GitHub Profile
@FagnerMartinsBrack
FagnerMartinsBrack / ProfitFromExample.js
Created January 9, 2018 01:53
(Medium) Incremental Delivery
// Usage: Copy this code and run in a ES6 capable Browser Console
function profitFrom({ sell, buy }) {
const profit = sell - buy;
return (100 * profit / buy) + '%';
}
console.log(`${profitFrom({ buy: 50, sell: 50 }) === '0%' && 'PASSED' || 'FAILED'}: No profit or loss for break even`);
console.log(`${profitFrom({ buy: 50, sell: 100 }) === '100%' && 'PASSED' || 'FAILED'}: Profit`);
console.log(`${profitFrom({ buy: 100, sell: 50 }) === '-50%' && 'PASSED' || 'FAILED'}: Loss`);
import requests
from bs4 import BeautifulSoup
import time
USER_AGENT = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'}
def fetch_results(search_term, number_results, language_code):
assert isinstance(search_term, str), 'Search term must be a string'
assert isinstance(number_results, int), 'Number of results must be an integer'
@AlwaysBCoding
AlwaysBCoding / notes.txt
Last active November 2, 2018 20:57
Ethereum Ðapp Development - Video 7 | Smart Contracts - Hello World
// package.json
{
"dependencies": {
"web3": "0.17.0-alpha",
"solc": "^0.4.4"
}
}
// HelloWorld.sol
contract HelloWorld {
@AlwaysBCoding
AlwaysBCoding / notes.txt
Last active November 2, 2018 20:09
Ethereum Ðapp Development - Video 6 | Sending MainNet Transactions With Code
// Infura
http://infura.io
// BlockCypher
http://blockcypher.com
@AlwaysBCoding
AlwaysBCoding / notes.txt
Last active July 25, 2022 16:46
Ethereum Ðapp Development - Video 3 | The Halting Problem And Why We Need Gas
// To learn more about the halting problem check out Gary Bernhardt's series on computation
https://www.destroyallsoftware.com/screencasts
// Ethereum Yellow Paper
http://gavwood.com/paper.pdf
// Ethereum OpCodes List
http://ethereum.stackexchange.com/questions/119/what-opcodes-are-available-for-the-ethereum-evm
// Ethereum OpCodes Gas Costs
@AlwaysBCoding
AlwaysBCoding / notes.txt
Last active November 2, 2018 19:13
Ethereum Ðapp Development - Video 2 | Creating Ethereum Keypairs
// package.json
{
"dependencies": {
"web3": "0.17.0-alpha",
"ethereumjs-util": "4.5.0"
}
}
// keypairs.js
var EthUtil = require("ethereumjs-util")
@AlwaysBCoding
AlwaysBCoding / notes.txt
Last active March 19, 2022 22:56
Ethereum Ðapp Development - Video 1 | Provisioning The Development Environment
// AlwaysBCoding Screencast - Introduction to AWS EC2
https://www.youtube.com/watch?v=jFBbcleSPoY
// Create a new EC2 Instance on aws.amazon.com (Amazon Linux AMI)
// =====================
// edit permissions on pem file
chmod 400 {keyfile}.pem
// ssh into instance, while exposing remote port for remote Atom
@alirobe
alirobe / reclaimWindows10.ps1
Last active May 27, 2024 21:14
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express
@staltz
staltz / introrx.md
Last active June 2, 2024 11:03
The introduction to Reactive Programming you've been missing