Skip to content

Instantly share code, notes, and snippets.

@ryedin
ryedin / cloudSettings
Last active June 4, 2021 20:15
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-06-04T20:15:38.636Z","extensionVersion":"v3.4.3"}
@ryedin
ryedin / App.js
Last active December 11, 2017 18:36
Example of single "app" constructed from multiple `Html.React` calls
import React, { Component } from 'react'
import { Provider, observer } from 'mobx-react'
import { viewDataStore } from './stores'
import { SomeComponentOne } from './SomeComponentOne'
@observer
class App extends Component {
render() {
return (
<Provider viewDataStore={viewDataStore}>
app.config(function($httpProvider) {
$httpProvider.interceptors.push(function($q, $location) {
return {
// Reject unauthenticated requests
responseError: function(rejection) {
if (rejection.status === 401) {
$location.nextAfterLogin = $location.path();
//prevent redirect to login or logout after login

Keybase proof

I hereby claim:

  • I am ryedin on github.
  • I am ryedin (https://keybase.io/ryedin) on keybase.
  • I have a public key ASA8cOt0BLuVGYMYSWveQRrqc8SkcY_NXi3tguJEvjcTbAo

To claim this, I am signing this object:

@ryedin
ryedin / hash_merge.js
Created December 21, 2015 21:50
Ryan Gahl interview with Digital H2O
var _ = require('lodash');
var hash1 = {
key1: 'abc',
key2: ['123', '222']
};
var hash2 = {
key2: 'def',
key4: '456'
@ryedin
ryedin / designer.html
Created October 13, 2014 16:50
designer
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../paper-calculator/paper-calculator.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@ryedin
ryedin / models.json
Created July 23, 2014 23:08
loopback models def
{
"user": {
"options": {
"base": "User"
},
"dataSource": "db",
"public": true
}
}
@ryedin
ryedin / direction_change.cs
Created October 23, 2013 21:51
detecting gallery direction changes
float current = 0;
if( isHorizontal ) current = transform.localPosition.x;
else current = -transform.localPosition.y;
float max = 0;
if( isHorizontal ) max = CellWidth+Spacing;
else max = CellHeight+Spacing;
//detect left/right direction changes
if (current < _last) {
Debug.Log("Moving Left");
@ryedin
ryedin / replacements.js
Created August 23, 2013 17:44
squares and curlies
var tmplExpressions = [
{
expression: /\[\[([^\]]*)\]\]/g,
replace: "{{$1}}"
},
{
expression: /\$\[([^\]]*)\]/g,
replace: "${$1}"
}
];
@ryedin
ryedin / repl.json
Created April 3, 2013 22:01
a replication doc example
{
"_id": "my_rep",
"source": "huterra_beta_v1r1",
"target": "huterra_v1_4_clean",
"filter": "replication_filters/static_content"
}