Skip to content

Instantly share code, notes, and snippets.

View felixSchl's full-sized avatar

Felix Schlitter felixSchl

View GitHub Profile
@andybangs
andybangs / GSEventEmitter.h
Last active February 4, 2019 03:03
Example RCTEventEmitter Subclass
#import "RCTEventEmitter.h"
#import "RCTBridge.h"
@interface GSEventEmitter : RCTEventEmitter <RCTBridgeModule>
+ (BOOL)application:(UIApplication *)application didSightBeacon:(NSString *)beaconID;
+ (BOOL)application:(UIApplication *)application didDepartBeacon:(NSString *)beaconID;
@end
@gelisam
gelisam / exchange-formats.md
Last active September 30, 2023 17:50
A list of every data exchange formats I could find

At work, I just spent the last few weeks exploring and evaluating every format I could find, and my number one criteria was whether they supported sum types. I was especially interested in schema languages in which I could describe my types and then some standard specifies how to encode them using an on-the-wire format, usually JSON.

  1. Swagger represents sum types like Scala does, using subtyping. So you have a parent type EitherIntString with two subtypes Left and Right represented as {"discriminator": "Left", value: 42} and {"discriminator": "Right", value": "foo"}. Unfortunately, unlike in Scala in which the parent type is abstract and cannot be instantiated, in Swagger it looks like the parent type is concrete, so when you specify that your input is an EitherIntString, you might receive {"discriminator": "EitherIntString"} instead of one of its two subtypes.
  2. JSON-schema supports unions, which isn't quite the same thing as sum types because
@db
db / bulletproof-npm-workflow.md
Last active January 20, 2017 03:15
Bulletproof NPM Workflow

Bulletproof NPM Workflow

Use the Bulletproof Git Workflow, and before code review:

pre-release package

Publish a pre-release version of the package:

@db
db / bulletproof-git-workflow.md
Last active January 11, 2024 06:05
bulletproof git workflow

Bulletproof Git Workflow

start working

git checkout master
git pull
git checkout -b feature/my-work
# edit your files
@jasonzoladz
jasonzoladz / Main.hs
Created February 4, 2016 19:39
Generate and Decode JWTs in Haskell with jose-jwt
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.Aeson.Encode as A
import Data.ByteString.Lazy (toStrict)
import Data.Either
@bkaradzic
bkaradzic / orthodoxc++.md
Last active May 17, 2024 10:22
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@novaluke
novaluke / 0-Q&A.md
Last active April 29, 2023 17:23
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@lopezjurip
lopezjurip / README.md
Created September 26, 2015 12:13
OSX Homebrew: docker-machine setup

Prerequisites

Make sure you have installed Homebrew and (Homebrew-Cask)[http://caskroom.io/].

# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install Homebrew-cask
brew install caskroom/cask/brew-cask
@jorihardman
jorihardman / sumo_logic.config
Last active April 27, 2023 18:43
Elastic Beanstalk Sumo Logic Config
# This will automatically install the Sumo Logic collector on AWS Elastic
# Beanstalk instances. Add this to the .ebextensions folder in your app root
# and edit L24-25 to match your Sumo Logic accessid and accesskey. To add or
# remove tracked files, simply add or remove source hashes to the sources
# array on L36.
packages:
rpm:
SumoCollector: https://collectors.sumologic.com/rest/download/rpm/64
services:
@hyOzd
hyOzd / delete-file-and-buffer.el
Created July 21, 2015 11:55
emacs delete current file and close the buffer
;; based on http://emacsredux.com/blog/2013/04/03/delete-file-and-buffer/
(defun delete-file-and-buffer ()
"Kill the current buffer and deletes the file it is visiting."
(interactive)
(let ((filename (buffer-file-name)))
(if filename
(if (y-or-n-p (concat "Do you really want to delete file " filename " ?"))
(progn
(delete-file filename)
(message "Deleted file %s." filename)