Skip to content

Instantly share code, notes, and snippets.

View sunny-g's full-sized avatar

Sunny Gonnabathula sunny-g

View GitHub Profile
@sectore
sectore / 01-createObservableFromDeviceEventEmitter.js
Last active November 26, 2023 06:42
[React Native + RxJS] Create an Observable from DeviceEventEmitter - An example to handle 'locationUpdated' event
import React, {DeviceEventEmitter} from 'react-native';
import {Observable} from 'rx-lite'
/**
* Creates an Observable to listen to any event of DeviceEventEmitter
* @param type {string} Event type
*/
export default createObservableFromDeviceEventEmitter$ = type => {
let subscription;
return Observable.fromEventPattern(
@yurydelendik
yurydelendik / !wasmllvm.md
Last active September 9, 2025 17:33
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active July 5, 2025 14:15
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@walkermatt
walkermatt / bbox-to-wkt-polygon.js
Created August 16, 2015 15:04
Create WKT POLYGON from a bounding box in JavaScript
var str = "POLYGON((left top,right top,right bottom,left bottom,left top))";
var bbox = {left: 10, top: 30, right: 20, bottom: 40};
str.replace(/[a-z]+/g, function(s) {return bbox[s];});
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 42 columns, instead of 22 in line 2.
Timestamp,First and Last Name,Hummingbird,Bluejay,Dolphin,Squirrel,Mouse,Sheep,Kangaroo,Owl,Cat,Toad,Frog,Ptarmigan,Elephant,Tapir,Gecko,Starling,Whale,Starfish,Pig,Dog,Rabbit,Chimpanzee,Lizard,Lion,Canary,Tiger,Lemur,Moose,Bobcat,Penguin,Gorilla,Shark,Jellyfish,Possum,Cicada,Panther,Bear,Parrot,Leopard,Panda
,Hummingbird,,I would especially enjoy working with this person.,,,,,,,,,,,,,,,I would especially enjoy working with this person.,I would especially enjoy working with this person.,,,,,,,,,,I would especially enjoy working with this person.,,,,I would especially enjoy working with this person.,,,,,,,,
,Bluejay,I would especially enjoy working with this person.,,I would especially enjoy working with this person.,,I would especially enjoy working with this person.,,,,"I would refuse to work with this person, due to OUR INTERPERSONAL ISSUES","I would refuse to work with this person, due to OUR INTERPERSONAL ISSUES",,,,I would especially enjoy working with this person.,,,,,,I would especially enjoy working w
@axefrog
axefrog / example.js
Last active October 4, 2016 04:01
Logging driver for cycle.js
import {Rx} from '@cycle/core';
export default function (responses, strings) {
var log = responses.log.create('Sample');
var str$ = Rx.Observable
.from(strings)
.do(str => {
log.trace('Just tracing stuff');
log.debug('Here is a debug message');
log.success('The successful thing happened that we wanted to happen');
@queertypes
queertypes / read-dt.org
Last active January 10, 2025 02:25
Implement a Dependently Typed Language and Then Some

Deploy MEAN application with Docker

Install Docker (for OS X)

(I'm not familiar with installation onto a Linux machine. Please follow the instructions on the Docker Installation page.)

[ ] If you're using OS X go directly to the boot2docker installation page, download the latest Boot2Docker pkg and install it on your laptop. This will install both Docker and Boot2Docker. The Docker installations docs have the following to say about Boot2Docker, which solves the issue for OS X users that Docker must be run on a host system with a Linux kernel.

Because the Docker daemon uses Linux-specific kernel features, you can't run Docker natively in OS X. Instead, you must install the Boot2Docker application. The application includes a VirtualBox Virtual Machine (VM), Docker itself, and the Boot2Docker management tool.

@dsernst
dsernst / Google Apps Script.md
Last active August 29, 2015 14:22
Outline from my "Google Apps Script" Lightning Talk @ Hack Reactor

Lightning Talk: Google Apps Script

  • What is Google Apps Script
    • Homepage: https://developers.google.com/apps-script/
    • Extend Google Apps: "Increase the power of your favorite Google apps — like Calendar, Docs, Drive, Gmail, and Sheets. Apps Script lets you do more with Google. All on a JavaScript platform in the cloud."
    • Written in Javascript
      • with lots of new Globals
      • everything is synchronous, no callbacks
      • have to use the Apps Script IDE
  • Runs on Google servers
#5 Aggregations in 5 Minutes: The Nickel Tour of the Aggregation Framework
###Sample Document
```
mongos> db.logs.findOne()
{
"_id" : ObjectId("556172a53004b760dde8a488"),
"d_id" : ObjectId("556172a53004b760dde8a443"),
"v" : 6205,
"timestamp" : ISODate("3129-12-13T02:03:17.906Z"),