Skip to content

Instantly share code, notes, and snippets.

View sergiokopplin's full-sized avatar
🌍
Working from home

Sérgio A. Kopplin sergiokopplin

🌍
Working from home
View GitHub Profile
import React, { Component } from 'react'
import Firebase from 'firebase'
import ReactFireMixin from 'reactfire'
import reactMixin from 'react-mixin'
const ref = new Firebase('https://<APPNAME>.firebaseio.com/users')
class UsersList extends Component {
constructor (props, context) {
super(props, context)
@jswebschmiede
jswebschmiede / snippet.js
Created September 6, 2012 22:31 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
* Tip: http://pivotallabs.com/users/jdean/blog/articles/1400-working-with-asynchronously-loaded-javascript
*/
(function(doc, script) {
var js,
const ComponentWithSavePost = graphql(savePostMutation, {
props: ({ mutate }) => ({
savePost: (title, body) => mutate({ variables: { title, body } }),
}),
})(Component);
Red Science:
0eNqdmttu6zYQRf9Fz1YhXhX7Vw4OCkVhE6K6QZLbBkH+vcqxnTQNHc/ik2Gb3kOtGc6F8Etx3x3DNMdhLQ4vRWzHYSkOP16KJT4OTff22fo8heJQxDX0xa4Ymv7t3dLGMLShnJr2z1IVr7siDg/hn+KgXn/uijCscY3hpPTrzfPvw7G/D/O24F2jWZbQ33dxeCz7pn2KQyj1ZmEal+3H4/BmexMs613xvL3ozcYc2jglzX8xo9/N/NEsa7nOzbBM47yW96FbE1bsyYrZrDzEzc7pO5tQNlDZJJV9Qtl+Vj5uROfHedxer2nrtPbu4rTxuE7HNcXHQTdUWV7wn58oDkuY1+2LL/LpB9EJyZpCMjcYxeEKorvPlpapi2ty8+fY0b+52z7es+hx4uBR1btyHx7isS9Dt62fY1tOYxe+SvuLdEpMsW3W4tOjPg5mN24h99RsDnz4JjLKMwIlQGCk4XYR1bfjTVnI9XLgdRKsy8seSkDW56U8iXSdJ60F0ndin+nkfpM++zhlS990Xdk1/XQ16SQdpelxet9dSgweJyN+Uq2zlAWO0bDOyaNJ26wcmHaTk4aPk+/P0xLjk1QFJUbXWXlW386FWnyu6u8Cdy9V8d+omCqv51Os2TAKpv/q9vkymeVKUK2MESWpcy5Ng7VZ1USQV0xenaoE7XNemZIo0yqlUzSSyrRISSJrn9WBwzNhK+nOLw5MidCZ7aQFZwVLj5oYtTVw//4r6jiPQ/kYmrn8+ymELvkANqdiCgLb0sN4ykGCbtz6LGVB+2DzWkZBZbN3WcrJOcfupTPeOcGJZjxXZSUiwZDnYCNZKrGyztqzIBKcgZ10dd1fzsIckXx+/XZHtcbufEH1/ye7+xhmz7bacWjnsIZfp/7Kcs2WK7S8QquZNtu4lErNINYMYs0g1ghijSDWCGKNIHoG0TOInkH0CKJHED2C6BFExyA6BtExiA5BdAiiQxAdgmgZRMsgWgbRIogWQbQIokUQDYNoGETDI
@bonndan
bonndan / .Xmodmap
Created March 18, 2014 21:21
xmodmap config for apple keyboard under ubuntu
! clean most of the modifiers
clear control
clear mod4
clear mod1
! gt, lt
keycode 49 = less greater less greater bar brokenbar bar
keycode 94 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032
! -----------------
@ecavalcanti
ecavalcanti / App.js
Created June 22, 2017 12:31
React Native - ActivityIndicator Overlay
import React, { Component } from 'react'
import { AppRegistry, View, Text, TextInput, StyleSheet, TouchableOpacity, ActivityIndicator } from 'react-native'
export default class App extends Component {
state = {
loading: false
}
renderLoading() {
if (this.state.loading) {
@KittyGiraudel
KittyGiraudel / MyCoolComponent.js
Last active January 1, 2021 07:24
A simple textarea + counter component, fully commented for React beginners. :)
import React from 'react';
import MyCoolTextarea from '../MyCoolTextarea';
import MyCoolCounter from '../MyCoolCounter';
const MyCoolComponent = React.createClass({
// Define a method on the parent component describing what should happen when
// the textarea gets updated. At this point, the only thing needed is to store
// the length of the textarea’s content in a state on the parent component.
//
@23maverick23
23maverick23 / font_awesome.rb
Last active January 30, 2022 11:38
Jekyll: Font Awesome icons Liquid tag
##
# The MIT License (MIT)
#
# Copyright (c) 2014 Ryan Morrissey
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@drmikecrowe
drmikecrowe / machine.js
Created November 21, 2019 18:47
Generated by XState Viz: https://xstate.js.org/viz
const RETRY_INTERVAL = 2000;
const MAX_RETRIES = 3;
const initHardwareState = "initHardware";
const connectNetworkState = "connectNetwork";
const provisionState = "provision";
const retryState = "retry";
const fatalState = "fatal";
const connectedState = "connected";
'padding-line-between-statements': [2,
// Always require blank lines after directive (like 'use-strict'), except between directives
{blankLine: 'always', prev: 'directive', next: '*'},
{blankLine: 'any', prev: 'directive', next: 'directive'},
// Always require blank lines after import, except between imports
{blankLine: 'always', prev: 'import', next: '*'},
{blankLine: 'any', prev: 'import', next: 'import'},
// Always require blank lines before and after every sequence of variable declarations and export
{blankLine: 'always', prev: '*', next: ['const', 'let', 'var', 'export']},
{blankLine: 'always', prev: ['const', 'let', 'var', 'export'], next: '*'},