Skip to content

Instantly share code, notes, and snippets.

View eusthace811's full-sized avatar

Eusthace Corin eusthace811

  • Noid
  • London, United Kingdom
  • Twitch hoshi818
View GitHub Profile
@eusthace811
eusthace811 / gist:e463974c84cd802c4d922d1bb806556e
Created May 31, 2019 14:51 — forked from 480/gist:3b41f449686a089f34edb45d00672f28
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings
1. Install oh my zsh
http://ohmyz.sh/
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
1. Install powerline fonts
https://github.com/powerline/fonts
1. download agnoster theme
https://github.com/mbadolato/iTerm2-Color-Schemes/zipball/master
@eusthace811
eusthace811 / 1_kubernetes_on_macOS.md
Created May 24, 2019 09:59 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@eusthace811
eusthace811 / index.js
Created April 17, 2019 13:52 — forked from codediodeio/index.js
Firebase Cloud Functions image thumbnail generator using Sharp for 4x faster resizing
const functions = require('firebase-functions');
const gcs = require('@google-cloud/storage')();
const sharp = require('sharp')
const _ = require('lodash');
const path = require('path');
const os = require('os');
exports.generateThumbnail = functions.storage.object('uploads/{imageId}').onChange(event => {
const object = event.data; // The Storage object.
@eusthace811
eusthace811 / package.json
Created April 10, 2019 11:51 — forked from niespodd/package.json
Making web3/bitcore-lib work with Angular 6
{...
"scripts": {
"postinstall": "node patch.js",
...
}
}
@eusthace811
eusthace811 / validIBAN.ts
Created April 5, 2019 15:08 — forked from cod3cow/validIBAN.ts
iban validation for angular2 / typescript
//this.validIBAN('DE89 3704 0044 0532 0130 00');
validIBAN(iban) {
// valid == 1
// invalid != 1
console.log(this.isValidIBANNumber(iban));
}
isValidIBANNumber(input) {
let CODE_LENGTHS = {
@eusthace811
eusthace811 / Games.sol
Last active November 6, 2018 03:48
Retrieve a list of casino games from an API using oraclise. Deployed at: 0xeb5828a8c5ca41e9519af53a02681aff9cd900e4 (https://ropsten.etherscan.io/address/0xeb5828a8c5ca41e9519af53a02681aff9cd900e4)
pragma solidity ^0.4.25;
import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";
import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/ownership/Ownable.sol";
contract Games is usingOraclize, Ownable {
string private list;
mapping (bytes32 => bool) private pendingQueries;
/**
@notice Generate random number from sig
@param _sigseed Sign hash for creation random number
@param _min Minimal random number
@param _max Maximal random number
@return random number
*/
function generateRnd(bytes _sigseed, uint _min, uint _max) public pure returns(uint) {
require(_max < 2**128);
return uint256(keccak256(_sigseed)) % (_max.sub(_min).add(1)).add(_min);
/**
@notice Generate random number from sig
@param _sigseed Sign hash for creation random number
@param _min Minimal random number
@param _max Maximal random number
@return random number
*/
function generateRnd(bytes _sigseed, uint _min, uint _max) public pure returns(uint) {
require(_max < 2**128);
return uint256(keccak256(_sigseed)) % (_max.sub(_min).add(1)).add(_min);
@eusthace811
eusthace811 / send-email-confirmation_index.js
Created November 20, 2017 23:25
Firebase Cloud Functions HTTP Trigger to send confirmation email utilizing SendGrid
'use strict';
const functions = require('firebase-functions');
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey("SEND_GRID_API_KEY"); /** replace with your own SendGrid API key */
const cors = require('cors')({
origin: ['ANGULAR_DEVELOPMENT_ENVIRONMENT_URL'], /** replace with the url of your development environment that serves your angular app. */
@eusthace811
eusthace811 / index.js
Created November 20, 2017 22:11 — forked from codediodeio/index.js
Transactional Email Firebase Cloud Function with Sendgrid
var functions = require('firebase-functions');
const sendgrid = require('sendgrid')
const client = sendgrid("YOUR_SG_API_KEY")
function parseBody(body) {
var helper = sendgrid.mail;
var fromEmail = new helper.Email(body.from);
var toEmail = new helper.Email(body.to);
var subject = body.subject;