Skip to content

Instantly share code, notes, and snippets.

View browniefed's full-sized avatar
🎧
Building

Jason Brown browniefed

🎧
Building
View GitHub Profile
@creationix
creationix / await.js
Last active December 15, 2015 16:49
await wrapper using node-fibers
var Fiber = require("fibers");
module.exports = await;
function await(continuation) {
var fiber = Fiber.current;
var result;
var async;
continuation(function (err, value) {
if (async === undefined) {
async = false;
anonymous
anonymous / gist:5408921
Created April 18, 2013 00:33
(function (window, app, undefined) {
'use strict';
app.factory('socket', ['$rootScope', function ($rootScope) {
var socket = $rootScope.socket;
var onCallback = function (callback, args) {
$rootScope.$apply(function () {
callback.apply(socket, args);
anonymous
anonymous / gist:5408941
Created April 18, 2013 00:37
// Make sure the socket is coming from our app by matching the session id
socketServer.set('authorization', function (data, accept) {
cookieParser(data, {}, function(err) {
if (err) {
accept(err, false);
} else {
config.sessionStore.load(data.signedCookies[config.sessionKey], function(err, session) {
if (err || !session) {
accept('Session error', false);
} else {
@quicksnap
quicksnap / ReRouter.re
Created April 5, 2017 22:47
Crappy React-router v4 bindings
external router : ReactRe.reactClass = "BrowserRouter" [@@bs.module "react-router-dom"];
external link : ReactRe.reactClass = "Link" [@@bs.module "react-router-dom"];
external route : ReactRe.reactClass = "Route" [@@bs.module "react-router-dom"];
module Router = {
let createElement children::(children: list ReactRe.reactElement) =>
ReactRe.wrapPropsShamelessly router {"children": Array.of_list children} ::children;
};
@domenic
domenic / q-mongoose-so.js
Last active August 24, 2017 05:49
Q + Mongoose from StackOverflow
var mongoose = require('mongoose');
mongoose.connect('mongo://localhost/test');
var conn = mongoose.connection;
var users = conn.collection('users');
var channels = conn.collection('channels');
var articles = conn.collection('articles');
var insertUsers = Q.nfbind(users.insert.bind(users));
var insertChannels = Q.nfbind(channels.insert.bind(channels));
@max-mapper
max-mapper / readme.md
Last active October 20, 2020 03:21
node modules for converting PDFs into other formats
@nilsandrey
nilsandrey / .dockerfile
Last active December 17, 2020 20:13
Dockerfile to containerize a Next.js app by @oliverjumpertz@twitter
FROM node: 14-alpine as build
ENV NEXT_TELEMETRY_DISABLED=1
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY ..
RUN yarn install && \
yarn build
FROM node: 14-alpine
@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

@tlakomy
tlakomy / jQuery>React.markdown
Last active August 17, 2022 12:08
Let's not forget about jQuery

In this talk I'd like to use 5 minutes of my time to explain to the audience why jQuery is simply way better than React.

  • Does React have a fadeIn() method? Nah, I don't think so. You need to install a react-transition-group package which weighs over 3GB.
  • Can you do $.get(https://stackoverflow.com/questions/12345/adding_two_numbers_javascript) in React? NOPE.
  • Remember React 3.3.1? Me neither, because they didn't make it. Meanwhile in jQuery land: https://code.jquery.com/jquery-3.3.1.min.js
  • Can you learn jQuery for free? Sure! Can you learn React for free? It'll be $500 USD and your left kidney for a conference ticket.

And many, many more.

(This is a completely serious lightning talk proposal, I promise.)

Hi Zach :D

Modals are funny beasts, usually they are a design cop-out, but that's okay, designers have to make trade-offs too, give 'em a break.

First things first, I'm not sure there is such thing as a "simple" modal that is production ready. Certainly there have been times in my career I tossed out other people's "overly complex solutions" because I simply didn't understand the scope of the problem, and I have always loved it when people who have a branch of experience that I don't take the time