Skip to content

Instantly share code, notes, and snippets.

Naman Goel nmn

Block or report user

Report or block nmn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View FacebookReactions.swift
//
// FacebookReactions.swift
//
// Created by Fabio Giolito on 10/06/2019.
// Follow me: https://twitter.com/fabiogiolito
//
import SwiftUI
struct FacebookReactions : View {
@markdalgleish
markdalgleish / MyComponent.js
Created Sep 11, 2015
CSS Modules + ReactCSSTransitionGroup in React 0.14
View MyComponent.js
import transitions from './transitions.css';
export default () => (
<ReactCSSTransitionGroup transitionName={transitions}>
{ ... }
</ReactCSSTransitionGroup>
);
@robertjpayne
robertjpayne / RCTSwiftBridgeModule.h
Last active Jul 23, 2019
React Native - Swift Native Modules
View RCTSwiftBridgeModule.h
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
#define RCT_EXTERN_MODULE(objc_name, objc_supername) \
RCT_EXTERN_REMAP_MODULE(objc_name, objc_name, objc_supername)
#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \
objc_name : objc_supername \
@end \
@interface objc_name (RCTExternModule) <RCTBridgeModule> \
@samwgoldman
samwgoldman / example.js
Last active Mar 14, 2019
Pure, stateless, type-checked React components with Immutable.js and Flow
View example.js
/* @flow */
var React = require("react")
var Immutable = require("immutable")
// In order to use any type as props, including Immutable objects, we
// wrap our prop type as the sole "data" key passed as props.
type Component<P> = ReactClass<{},{ data: P },{}>
type Element = ReactElement<any, any, any>
View ObservePolyfill.js
export default {
getInitialState() {
const data = {};
this.subscribe(this.props, this.context, (key, value) => {
data[key] = value;
});
this.unsubscribe();
return { data };
@rjchatfield
rjchatfield / transducers.swift
Last active Jan 13, 2019
Transducers & Reducers in Swift 2
View transducers.swift
//-- This is an introduction to Transducers in Swift, inspired by
// Talk: https://www.youtube.com/watch?v=estNbh2TF3E
// Code: https://github.com/mbrandonw/learn-transducers-playground
// Updated with Swift 2
/**
* Define a few test methods
*/
/// REDUCER
func append <A> (xs: [A], x: A) -> [A] { return xs + [x] }
@mikermcneil
mikermcneil / using-raw-socket-io-in-sails.js
Created Sep 17, 2013
Using raw socket.io functionality in a Sails.js controller
View using-raw-socket-io-in-sails.js
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {
You can’t perform that action at this time.