Skip to content

Instantly share code, notes, and snippets.

View johncrisostomo's full-sized avatar
🌏
Not much contrib here as my org is now using a ADO exclusively

John Crisostomo johncrisostomo

🌏
Not much contrib here as my org is now using a ADO exclusively
  • JLL Technologies
  • Singapore
View GitHub Profile
@johncrisostomo
johncrisostomo / arduino-bluetooth-led.ino
Created May 7, 2018 01:22
Arduino LED controlled over Bluetooth with NodeJS forked from eelcocramer
// This code uses the SoftwareSerial library.
// It can be obtained here: http://arduino.cc/en/Reference/SoftwareSerial
unsigned int timeout=0;
unsigned char state=0;
char val; // variable to receive data from the serial port
int ledpin = 13; // LED connected to pin 13
// Timer2 service
@johncrisostomo
johncrisostomo / permAlone.js
Created May 7, 2018 01:25
my solution for 'no repeats please' on fcc
function permAlone(str) {
if (str.length === 1) {
return 1;
}
var factorial = fact(str.length);
var permutations = computePermutations(str.split(''), factorial);
var unique = permutations.filter(function (perm) {
return !perm.match(/(.)\1{1,}/);
});

Keybase proof

I hereby claim:

  • I am johncrisostomo on github.
  • I am johncrisostomo (https://keybase.io/johncrisostomo) on keybase.
  • I have a public key ASAh5aiooh4CROSQ5hQpK9sqS2FRtFPknkZPl0QSM_-bngo

To claim this, I am signing this object:

@johncrisostomo
johncrisostomo / Component.jsx
Created July 25, 2018 09:16 — forked from krambertech/Component.jsx
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
@johncrisostomo
johncrisostomo / SimpleHttpClient.cs
Created July 30, 2018 08:59 — forked from bryanbarnard/SimpleHttpClient.cs
Simple C# .NET 4.5 HTTPClient Request Using Basic Auth and Proxy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net;
namespace HTTP_Test
@johncrisostomo
johncrisostomo / cosmosdbtest.js
Created December 4, 2018 02:24
connecting and querying cosmodb sql api with nodejs
const CosmosClient = require('@azure/cosmos').CosmosClient;
const cosmosClient = new CosmosClient({
endpoint: '', // connection url
auth: {
masterKey:
'' // master key
}
});
@johncrisostomo
johncrisostomo / fromBeginning.js
Created February 28, 2019 04:27
tailing the cosmosdb change feed
const options = { startFromBeginning: true };