Skip to content

Instantly share code, notes, and snippets.

View ncksllvn's full-sized avatar
☮️

Nick Sullivan ncksllvn

☮️
View GitHub Profile
@azproduction
azproduction / LICENSE.txt
Created January 17, 2012 08:21 — forked from 140bytes/LICENSE.txt
Tiny ajax
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mikhail Davydov <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@dbainbridge
dbainbridge / app.js
Created April 19, 2012 20:48
How to use socket.io with Express 3
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http');
var app = express();
var server = app.listen(3000);
@theangryangel
theangryangel / AuthController.js
Created February 28, 2013 21:54
sails (v0.8.82) + passport + passport-local Rough Example. For the love of all that is holy, don't use this in production.
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
@mijia
mijia / mdl-react.js
Last active September 15, 2016 08:36
Hook up the mdl componentHandler with React Router
let MDLUpgrade = function(Component) {
const MDLComponent = React.createClass({
componentDidUpdate() {
componentHandler.upgradeDom();
},
render() {
return <Component {...this.props} />;
},
@umarmw
umarmw / assertions-compareScreenshot.js
Last active May 20, 2019 11:29 — forked from richard-flosi/assertions-compareScreenshot.js
Nightwatch with Visual Regression testing
// location: ./assertions/compareScreenshot.js
var resemblejs = require('node-resemble-js'),
fs = require('fs');
exports.assertion = function(filename, expected) {
var screenshotPath = 'test/screenshots/',
baselinePath = screenshotPath + 'baseline/' + filename,
resultPath = screenshotPath + 'results/' + filename,
diffPath = screenshotPath + 'diffs/' + filename;
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active June 6, 2025 19:32
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

@Rhymond
Rhymond / Dockerfile
Last active July 8, 2018 16:41
Dockerize create-react-app or create-react-native-app
FROM node:latest
RUN apt-get update && \
apt-get -y install software-properties-common git-core build-essential automake unzip python-dev python-setuptools && \
rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/facebook/watchman.git /tmp/watchman
WORKDIR /tmp/watchman
RUN ./autogen.sh
RUN ./configure
@laurent22
laurent22 / javascript_warnings.md
Last active March 9, 2025 10:02
How many warnings should your JavaScript app have?

How many warnings should your JavaScript app have?

JavaScript warnings are these messages being displayed in yellow or red in your JavaScript console or terminal. They make no sense at all in general but they are a good indication of the health of your app. The points below will give you a general idea of how many warnings you should expect in your app:

  • 0 warnings: the app is not working at all

  • 5 warnings: app is probably starting but crashing soon after - try to find why it crashes. You'd think you could read the warnings to learn why it doesn't work, but that's not what warnings are for.

  • 50 warnings: That's the soft spot - most likely everything's running smoothly