Skip to content

Instantly share code, notes, and snippets.

View rhlsthrm's full-sized avatar
🚀
Shipping

Rahul Sethuram rhlsthrm

🚀
Shipping
View GitHub Profile
@rhlsthrm
rhlsthrm / insertIntoZohoCRM.js
Created December 15, 2017 19:03
Node Express API endpoint code to insert records into Zoho CRM. Use library to generate XML and properly encode.
const axios = require('axios')
const xml = require('xml')
const { asyncRequest } = require('../util')
const { getModels } = require('../models')
const querystring = require('querystring')
const handler = async (req, res) => {
const { MailingList } = getModels()
const { email } = req.body
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!
✅ did:muport:QmZZQ3eTyyxKXyGv7GLdHGQWFg3BthznK9UeTGFaWdHpVw ✅
Create your profile today to start building social connection and trust online. https://3box.io/
pragma solidity 0.5.3;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : dave@akomba.com
// released under Apache 2.0 licence
// input /Users/rahul/Desktop/connext/connext/moloch-monorepo/packages/moloch/contracts/Moloch.sol
// flattened : Friday, 08-Feb-19 19:41:10 UTC
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
@rhlsthrm
rhlsthrm / SwiftAsyncAwaitExample.swift
Last active January 31, 2019 03:20
Using PromiseKit and AwaitKit to write synchronous looking async code.
import PromiseKit
import AwaitKit
struct Todo: Decodable {
var userId: Int
var id: Int
var title: String
var completed: Bool
}
@rhlsthrm
rhlsthrm / tedious.js
Created July 27, 2018 00:20
Example of creating and awaiting Promise in Node
// return a promise so you can await it
function Insert_Machine(msg, callback) {
var result = [];
var connection = new Connection(machine_config);
return new Promise(function(resolve, reject) {
connection.on("connect", function(err) {
var request = new Request( // set up request structure
"INSERT INTO dbo.Data_new (pp_id, d_No, d_Note, d_Data, d_seq, d_machine, d_DateTime) OUTPUT INSERTED.Id VALUES (@pp_id, @d_No, @d_Note, @d_Data, 0, @d_machine, @d_DateTime);",
function(err, rowCount) {
if (err) {

Keybase proof

I hereby claim:

  • I am rhlsthrm on github.
  • I am rhlsthrm (https://keybase.io/rhlsthrm) on keybase.
  • I have a public key ASAQ4qooOAk2XGA9jkZO4Jf-Cz18h2tZ3hhb1IoeF2VQzQo

To claim this, I am signing this object:

  • Working genesis.json:

`{ "config": { "chainId": 15, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 }, "alloc": {},

@rhlsthrm
rhlsthrm / bracket_validator.py
Created July 11, 2017 21:26
Validates that brackets are properly aligned
def bracket_validator(arg):
openers = []
for char in arg:
if char == '(':
openers.append('paren')
elif char == '{':
openers.append('curly')
elif char == '[':
openers.append('square')
elif char == ')':
service: bittman
provider:
name: aws
runtime: nodejs4.3
environment:
DYNAMODB_TABLE: ${self:service}-${opt:stage, self:provider.stage}
iamRoleStatements:
- Effect: Allow
Action: