Skip to content

Instantly share code, notes, and snippets.

View sibelius's full-sized avatar
🦈
give me a feedback https://entria.feedback.house/sibelius

Sibelius Seraphini sibelius

🦈
give me a feedback https://entria.feedback.house/sibelius
View GitHub Profile
@juanmiguelbesada
juanmiguelbesada / ngSwal.js
Created February 18, 2015 16:45
ngSwal - Sweet Alert in an angular way
angular.module("ngSwal", [])
.service('swal', function($q, $window, $timeout) {
var swal = $window.swal;
this.success = function (title, text) {
return this.swal({
title: title,
text: text,
type: 'success'
});
@dhrrgn
dhrrgn / RNDigits.m
Created August 13, 2015 16:16
Digits React Native module.
//
// RNDigits.m
//
// Created by Dan Horrigan on 8/13/15.
// Copyright (c) 2015 Tackk, Inc. All rights reserved.
//
#import <DigitsKit/DigitsKit.h>
#import "RCTBridgeModule.h"
#import "RCTEventDispatcher.h"

Layer Webhooks Pre-release

Webhooks allow you to develop integrations which subscribe to events within your Layer application. When a subscribed event is triggered, Layer will send an HTTP POST payload to the endpoint designated in the webhook configuration. Webhooks provide a simple, flexible mechanism that you can use to signal an external system to take action in response to messaging activity within your app. You can use Webhooks to implement things like:

  • Add context to conversations: respond to messages mentioning keywords.
  • Notify another user when they are @mentioned
  • Send a welcome message when a user registers (build a great onboarding experience)
  • Integrate a third-party service (Uber API, Weather Underground, etc) into conversations based on context

Event Types

// Require all .js and .jsx files inside tree
let reactFiles = require.context("./components", true, /^(.*\.(jsx?$))[^.]*$/igm);
reactFiles.keys().forEach(function(key){
reactFiles(key);
});
@knowbody
knowbody / import.json
Created April 26, 2016 15:16
My Atom Setup (use https://atom.io/packages/config-import-export to import/export)
{"version":1.02,"files":[{"file":".gitignore","content":{"type":"Buffer","data":[98,108,111,98,45,115,116,111,114,101,10,99,111,109,112,105,108,101,45,99,97,99,104,101,10,100,101,118,10,115,116,111,114,97,103,101,10,46,110,111,100,101,45,103,121,112,10,46,110,112,109,10]}},{"file":"config.cson","content":{"type":"Buffer","data":[34,42,34,58,10,32,32,34,97,116,111,109,45,109,97,116,101,114,105,97,108,45,117,105,34,58,10,32,32,32,32,99,111,108,111,114,115,58,10,32,32,32,32,32,32,97,98,97,115,101,67,111,108,111,114,58,10,32,32,32,32,32,32,32,32,97,108,112,104,97,58,32,49,10,32,32,32,32,32,32,32,32,98,108,117,101,58,32,50,52,51,10,32,32,32,32,32,32,32,32,103,114,101,101,110,58,32,49,53,48,10,32,32,32,32,32,32,32,32,114,101,100,58,32,51,51,10,32,32,32,32,32,32,112,114,101,100,101,102,105,110,101,100,67,111,108,111,114,58,32,34,66,108,117,101,34,10,32,32,32,32,102,111,110,116,115,58,32,123,125,10,32,32,32,32,116,97,98,115,58,10,32,32,32,32,32,32,116,105,110,116,101,100,84,97,98,66,97,114,58,32,116,114,117,101,10,32
@twogood
twogood / gist:209aaa495f87a5563fe3
Last active May 17, 2016 15:12
idea phpstorm ibus keyboard fix
ibus restart && sleep 1 && ibus engine xkb:se::swe
@AndrewIngram
AndrewIngram / gist:3cc2d48359ab173b5e7d7b7f620aa5bc
Created April 21, 2016 14:12
GraphQL Unauthorized Union Type
var AuthStringType = new GraphQLUnionType({
name: 'AuthorizedString',
types: [ GraphQLString, UnauthorizedType ],
resolveType(value) {
if (value instanceof String) {
return GraphQLString;
}
if (value instanceof Error) {
return UnauthorizedType;
}
@AndrewIngram
AndrewIngram / injected-resolvers.js
Created June 9, 2016 10:27
Cleaner graphql-js types
import * as resolvers from './fooResolvers';
function injectResolvers(resolvers, fieldFunc) {
return function() {
const fields = fieldFunc();
return Object.keys(fields).reduce((previous, key) => {
const field = fields[key];
return {
@ecgreb
ecgreb / CustomTestRunner.java
Last active July 11, 2016 14:01
CustomTestRunner (Robolectric 2.x) and Crashlytics shadow class
package com.example;
import com.example.shadows.ShadowCrashlytics;
import org.junit.runners.model.InitializationError;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.bytecode.ClassInfo;
import org.robolectric.bytecode.Setup;
import org.robolectric.bytecode.ShadowMap;
@AndrewIngram
AndrewIngram / example.js
Last active July 12, 2016 02:40
Schema definition
/* @flow */
import {
GraphQLSchema,
} from 'graphql';
import { Registry } from 'graphql-helpers';
import { middleware } from 'graphql-helpers/lib/contrib/relay';
const registry = new Registry(middleware);