Skip to content

Instantly share code, notes, and snippets.

View Ivshti's full-sized avatar
🐊
.

Ivo Georgiev Ivshti

🐊
.
View GitHub Profile
// include the basic windows header files and the Direct3D header file
#include <windows.h>
#include <windowsx.h>
#include <d3d9.h>
// define the screen resolution
#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 600
// include the Direct3D Library file

ADEX CONTRIBUTOR COPYRIGHT ASSIGNMENT AGREEMENT

The present Contributor Copyright Assignment Agreement (hereinafter referred to as the “Agreement”) applies to any Contribution you make to AdEx.

This Agreement represents a binding agreement between You, the legal entity You represent and AdEx in connection to any Contribution you make to any part of the source code of AdEx. If You represent a legal entity, You declare that You are duly authorized on behalf of it to agree to this Agreement.

1. Definitions

STREMIO CONTRIBUTOR COPYRIGHT ASSIGNMENT AGREEMENT

The present Contributor Copyright Assignment Agreement (hereinafter referred to as the “Agreement”) applies to any Contribution you make to Stremio.

This Agreement represents a binding agreement between You, the legal entity You represent and Smart Code in connection to any Contribution you make to any part of the source code of Stremio. If You represent a legal entity, You declare that You are duly authorized on behalf of it to agree to this Agreement.

1. Definitions

#!/usr/bin/env node
// WARNING: run with NODE_ENV=production for mainnet results!
const ethers = require('ethers')
const FactoryABI = require('adex-protocol-eth/abi/IdentityFactory')
const { provider, providerLogs } = require('../services/eth/provider')
const cfg = require('../cfg')
const ERC20ABI = require('../abi/ERC20')
const Factory = new ethers.Contract(cfg.identityFactoryAddr, FactoryABI, providerLogs)
#!/usr/bin/env bash
set -e
HOST=$1
sync-github-keys() {
local CONTROL_KEY GITHUB_USERNAME
CONTROL_KEY=`mktemp`
GITHUB_USERNAME=$1
@Ivshti
Ivshti / sendTokens.js
Created December 20, 2019 00:32
send tokens via Relayer 1.0
#!/usr/bin/env node
require('dotenv').config()
const { wallet } = require('../services/eth/wallet')
// First successful tx, with deployAndExecute: https://etherscan.io/tx/0x49576fa495153de77eb2dfedeabe7fa6072d0e94b993c5c44ae6e025471d174a
// second, with a slightly modified script (changed the nonce, fee amount and SAI amount): https://etherscan.io/tx/0xffe806ff5cd8f9cfbd54f172efeacac7586d7836c26a880e022151b044b2ead6
const identityAddr = '0x71e0be831fe24bd61d7b5495cb7bb193fcc5e24d'
### Keybase proof
I hereby claim:
* I am Ivshti on github.
* I am ivogeorgiev (https://keybase.io/ivogeorgiev) on keybase.
* I have a public key whose fingerprint is AC69 2BE9 EB6E 024B 5C58 A8EA C1E9 4996 BC56 BACE
To claim this, I am signing this object:
pragma solidity ^0.5.6;
pragma experimental ABIEncoderV2;
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
@Ivshti
Ivshti / manifest.js
Created February 18, 2019 13:37
Addon manifest
{
id: 'org.myexampleaddon',
version: '1.0.0',
name: 'simple example',
// Properties that determine when Stremio picks this add-on
// this means your add-on will be used for streams of the type movie
catalogs: [],
resources: ['stream'],
@Ivshti
Ivshti / fetch.rs
Created January 13, 2019 13:05
fetch - get a Vec<u8>
let window = web_sys::window().unwrap();
let pr = window.fetch_with_str("https://v3-cinemeta.strem.io/catalog/movie/top.json");
let fut = JsFuture::from(pr)
.and_then(|resp_value| {
// @TODO: reduce number of copies
assert!(resp_value.is_instance_of::<Response>());
let resp: Response = resp_value.dyn_into().unwrap();
let buf_promise = resp.array_buffer().unwrap();
JsFuture::from(buf_promise).map(|buf_val| {
assert!(buf_val.is_instance_of::<ArrayBuffer>());