Skip to content

Instantly share code, notes, and snippets.

View fmoliveira's full-sized avatar

Filipe Oliveira fmoliveira

  • Level Access
  • Toronto
  • 18:07 (UTC -04:00)
View GitHub Profile
var request = require('supertest-as-promised'),
Promise = require('bluebird'),
should = require('should');
var game = require('../game.js').app;
// Instead of assertScoreEquals, we now fetch the score
// and assert when the promise returns a value
var getScore = function() {
return request(game).get('/score').expect(200)
@rek
rek / gist:f18a7e38b8e4e3686584
Created September 4, 2014 06:26
Dust.js Cheatsheet
{?cond}
cond is true
{:else}
cond is not true
{/cond}
{^cond}
cond is false
{:else}
cond is not false
@sibelius
sibelius / Codemod RN24 to RN25.md
Last active November 9, 2016 13:09
Codemod React Native 24 imports to RN25 imports

README

Why this transform is necessary?

Until React Native 24, you import React from 'react-native' package, but this will change on RN 25, you will need to import React from 'react'. You probably have many files that does this, so I've created a codemod to save you a bunch of time

How to use this

  • Install jscodeshif
@nolim1t
nolim1t / home.jade
Created May 11, 2012 05:19
Sample Templating with express and jade
h2 Hello World
h3 Hello World
:markdown
This is some **test** markdown text
we can even link to [stuff](http://google.com)
ul.list
- each i in data
li=i.name
@sibelius
sibelius / Info.plist
Created November 17, 2016 15:34
ios 10 permissions
<!-- 🖼 Photo Library -->
<key>NSPhotoLibraryUsageDescription</key>
<string><Your description goes here></string>
<!-- 📷 Camera -->
<key>NSCameraUsageDescription</key>
<string><Your description goes here></string>
<!-- 🎤 Microphone -->
<key>NSMicrophoneUsageDescription</key>
anonymous
anonymous / tilemapper.cs
Created April 10, 2016 16:47
// Unity 2D Tile MapperCode by Kaisirak
// https://www.youtube.com/watch?v=_x0bMTxP7Yw
// Modified to work for Unity 5.3.4f (April 11, 2016)
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
using System.Linq;
using System.Collections.Generic;
// put this at the top of your app
const setState = Component.prototype.setState
Component.prototype.setState = function(nextState) {
console.group(this.constructor.name)
console.trace()
if (this.shouldComponentUpdate) {
console.log('shouldComponentUpdate', (
this.shouldComponentUpdate(this.props, nextState)
))
}
@amoslanka
amoslanka / .gitignore
Last active January 15, 2018 01:42
Simple session-stored auth on Node.js
*node_modules/
.DS_Store
@Voles
Voles / datefilter.js
Created April 25, 2013 12:41
AngularJS daterange filter
RB.filter('daterange', function ()
{
return function(conversations, start_date, end_date)
{
var result = [];
// date filters
var start_date = (start_date && !isNaN(Date.parse(start_date))) ? Date.parse(start_date) : 0;
var end_date = (end_date && !isNaN(Date.parse(end_date))) ? Date.parse(end_date) : new Date().getTime();
@cssoul
cssoul / react-loading.js
Created July 22, 2015 02:48
React Native Loading Animation
/**
* LoadingView
*/
'use strict';
var React = require('react-native');
var {
TouchableWithoutFeedback,
Animated,