Skip to content

Instantly share code, notes, and snippets.

View tilomitra's full-sized avatar
👋

Tilo Mitra tilomitra

👋
View GitHub Profile
@tilomitra
tilomitra / react-snippet.jsx
Last active June 13, 2021 16:03
Run this through parceljs to embed on a Square Store via Snippets API
import React from "react";
import ReactDOM from "react-dom";
function Frontend() {
return <div>Sample Snippet Content - TESTING*******************</div>;
}
// self executing function here
(function () {
// your page initialization code here
@tilomitra
tilomitra / kafka-producer.js
Created April 10, 2020 23:11
Kafka Produer
import kafka from "kafka-node";
import uuid from "uuid";
const client = new kafka.Client("http://localhost:2181", "my-client-id", {
sessionTimeout: 300,
spinDelay: 100,
retries: 2
});
const producer = new kafka.HighLevelProducer(client);
@tilomitra
tilomitra / App.js
Last active November 28, 2019 21:55
A Recorder React component that interacts with the Houndify API
import React, { useState } from "react";
import Recorder from "./Recorder";
function App() {
const [convoState, setConvoState] = useState({});
const [response, setResponse] = useState("");
const [error, setError] = useState(null);
const [requestInfo, setRequestInfo] = useState({
UserID: "test_user",
Latitude: 37.388309,
@tilomitra
tilomitra / user-settings.json
Last active May 2, 2019 20:08
VS Code User Settings
{
"editor.formatOnSave": true,
// Enable per-language
"[javascript]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"emmet.syntaxProfiles": {
@tilomitra
tilomitra / kafka-consumer.js
Created November 6, 2017 20:01
Kafka Consumer in NodeJS
import kafka from "kafka-node"
const client = new kafka.Client("http://localhost:2181");
const topics = [
{
topic: "webevents.dev"
}
];
const options = {
@tilomitra
tilomitra / kafka-consumer.js
Last active June 6, 2018 04:32
Kafka Producer in NodeJS
import kafka from "kafka-node"
const client = new kafka.Client("http://localhost:2181");
const topics = [
{
topic: "webevents.dev"
}
];
const options = {
@tilomitra
tilomitra / animations.css
Last active March 27, 2023 13:55
Common CSS Infinite Animations (pulsate, opacityPulse, alertPulse, rotating).
/* Make the element pulse (grow large and small slowly) */
/* Usage
.myElement {
animation: pulsate 1s ease-out;
animation-iteration-count: infinite;
opacity: 1;
}
*/
@-webkit-keyframes pulsate {
0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;}
// Get all applications from the applicationList store
exports.allApplications = ['applicationList'];
// Get the search term from the searchTerm Store
exports.searchTerm = ['searchTerm'];
// Create a getter called filteredApplicationList, that takes
// the above two stores, filters the appList against the search
// query, and returns the result.
exports.filteredApplicationList = [
@tilomitra
tilomitra / Preferences.sublime-settings
Created June 19, 2015 00:19
Sublime Text 3 Settings File
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_inactive_tabs": true,
"color_scheme": "Packages/Theme - Hero/Hero Dark.tmTheme",
"fade_fold_buttons": false,
"font_face": "Source Code Pro",
"font_size": 13.0,
"highlight_line": true,
"ignored_packages":
YUI.add('event-hammer', function (Y, NAME) {
/*
Copyright 2013 Yahoo! Inc.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
'use strict';
//loop through Hammer.gestures
var HAMMER_GESTURES = [