Skip to content

Instantly share code, notes, and snippets.

package async
import (
"sync"
)
type AllResult struct {
values []interface{}
errors []error
hasError bool

Keybase proof

I hereby claim:

  • I am aventurella on github.
  • I am aventurella (https://keybase.io/aventurella) on keybase.
  • I have a public key whose fingerprint is C376 4854 066A EEAB 7731 0E34 FD1E FCE2 1832 DB6A

To claim this, I am signing this object:

@theladyjaye
theladyjaye / Store.swift
Created March 22, 2017 14:43
If I understand it, this is basically all Redux is using RxSwift
// I say basically, because it does more then this to be sure (middleware etc),
// but at the "reduce" things level, I think this covers it.
import Foundation
import RxSwift
let stateQueue = DispatchQueue(label: "com.redux.action")
@theladyjaye
theladyjaye / sketch.ino
Last active February 1, 2017 23:20
Adafruit Bluefruit LE SPI Friend - Make an Eddystone Beacon
// GATT Member codes (16 bits / 2 Bytes)
// https://www.bluetooth.com/specifications/assigned-numbers/16-bit-uuids-for-members
//
// Note that the relevant google registry entry is:
// 65194 0xFEAA Google 12-Mar-2015
// Eddystone Service UUID of 0xFEAA (see docs here: https://github.com/google/eddystone/blob/master/protocol-specification.md#common-elements)
//
// GAP Codes
// https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile
//
@theladyjaye
theladyjaye / decorators.md
Last active May 31, 2022 11:57
Marionette TypeScript Utils
@theladyjaye
theladyjaye / models.swift
Last active December 29, 2015 19:15
Realm Primary Key Insert Performance @ 1 million + 1 records
import Foundation
import RealmSwift
class StringObject: Object{
dynamic var id: String = ""
override static func primaryKey() -> String{
return "id"
}
@theladyjaye
theladyjaye / gist:442d176a93b65c644f14
Last active June 12, 2018 19:47 — forked from FigBug/gist:4947379
Redirecting embedded Python’s I/O
Redirecting embedded Python’s I/O
Posted on 2012-4-13 by mvasilkov
When using Python for application scripting, more often than not you want to redirect interpreter’s input/output to the embedding program. This is how it’s done with the Python/C API:
PyObject *sys = PyImport_ImportModule("sys");
PyObject *out = PyFile_FromString("python_out", "w+");
PyObject_SetAttrString(sys, "stdout", out);
Pretty intuitive, right? Now embedded Python’s stdout points to the newly created file, python_out. Working with the script’s output from C is also trivial:
@theladyjaye
theladyjaye / _install.md
Last active August 29, 2015 14:07
django-oauth2-provider scheme patch

How to Install

New files:

  • There are 3 new files you will need to add.
  • You will need to vendor in django-oauth2-provider into your project.

Once done, add a folder in provider/oauth2 called ext. In the end this path will exist: provider/oauth2/ext.

Place the 3 files below into that folder with an __init__.py

@theladyjaye
theladyjaye / cmd.sh
Created October 18, 2013 21:06
clear salt minion cache
salt '*' cmd.run 'rm -rm /var/cache/salt/minion/files/base/*'
salt '*' saltutil.sync_all
@theladyjaye
theladyjaye / jasmine-karma.js
Created October 13, 2013 18:53
Karma with Jasmine and Require (and jasmine-jquery)
define(function(require, exports, module) {
// Imports
// make require load jquery and jasmine-jquery
require('jquery');
require('jasmine/jasmine-jquery');
// jquery-jasmine
// now getFixtures() will be available.