Skip to content

Instantly share code, notes, and snippets.

@vjpr
vjpr / README.md
Last active February 4, 2016 21:29 — forked from skevy/gist:8a4ffc3cfdaf5fd68739
Reduce boilerplate in Redux

Reduce boilerplate in Redux

  • Create actions similar to Flummox.
  • Generate action ids.
  • Supports actions with promises, and therefore ES7 async.

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@nijikokun
nijikokun / base64-utf8.module.js
Last active February 11, 2024 23:16
Javascript Base64 UTF8 for the Browser / Server. Base64 UTF-8 Encoding and Decoding Libraries / Modules for AMD, CommonJS, Nodejs and Browsers. Cross-browser compatible.
// UTF8 Module
//
// Cleaner and modularized utf-8 encoding and decoding library for javascript.
//
// copyright: MIT
// author: Nijiko Yonskai, @nijikokun, nijikokun@gmail.com
(function (name, definition, context, dependencies) {
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); }
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); }
else { context[name] = definition.apply(context); }
@igorw
igorw / gist:4475804
Last active October 4, 2019 15:32
Composer Versioning
@billroy
billroy / InputCapture.ino
Created November 7, 2012 16:33
Arduino input capture example
/***
InputCapture.ino
Timer 1 high-resolution timing facility.
Copyright (C) 2008-2012 Bill Roy
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@merk
merk / JobController.php
Last active October 10, 2015 14:17
Use of a FormType to build a filter for a list of entities
<?php
namespace Ibms\JobBundle\Controller;
class JobController extends BaseJobController
{
/**
* Job list.
*
* @param \Symfony\Component\HttpFoundation\Request $request
@merk
merk / composer.json
Last active October 10, 2015 02:07
Example project composer.json
{
"autoload": {
"psr-0": {
"": "src/"
}
},
"require": {
"php": "~5.4",
"symfony/assetic-bundle": "2.1.*@dev",
@merk
merk / GroupManager.php
Created March 22, 2012 02:37
ObjectManager/Manager service trait test. Allows multiple object Manager classes to use Doctrine's ObjectManager, rather than reimplementing the same functions again and again.
<?php
namespace Ibms\CustomerBundle\Entity;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\QueryBuilder;
/**
* Manages Group objects.
*