Skip to content

Instantly share code, notes, and snippets.

View hellobrian's full-sized avatar
🏠
Working from home

Brian Han hellobrian

🏠
Working from home
View GitHub Profile
@hellobrian
hellobrian / test.js
Created March 21, 2015 01:19
test suite mocha supertest
var request = require('supertest');
var app = require('./app');
function makeGetRequest(urlPath) {
return request(app).get(urlPath);
}
//--------------- HOME PAGE ---------------//
describe('Requests for Home page (index)', function() {
it('Returns a 200 status code', function(done) {
var express = require('express');
var router = express.Router();
// Import Twitter SDK Library
var Twitter = require('twitter');
// Need to store these credentials in ENV variables
var credentials = require('../credentials.js');
var client = new Twitter({
consumer_key: credentials.twitter.consumerKey,
@hellobrian
hellobrian / routes-apps.js
Last active August 29, 2015 14:19
node vs npm
{ title: 'node',
version: 'v0.12.0',
moduleLoadList:
[ 'Binding contextify',
'Binding natives',
'NativeModule events',
'NativeModule util',
'NativeModule buffer',
'Binding buffer',
'Binding smalloc',
@hellobrian
hellobrian / gulpfile.js
Created June 9, 2015 14:11
Gulp - June 9 2015
var gulp = require('gulp');
var sass = require('gulp-sass');
var scsslint = require('gulp-scss-lint');
var size = require('gulp-size');
var csso = require('gulp-csso');
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync');
var plumber = require('gulp-plumber');
var reload = browserSync.reload;
@hellobrian
hellobrian / pokemon.js
Created June 13, 2015 02:18
pokemon api
var express = require('express'),
Pokemon = require('../models/pokemon.js'),
apiRouter = express.Router();
apiRouter.use(function(req, res, next) {
// console.log('Somebody just came to our app!');
// console.log('This is where we will authenticate users -- but later!');
next();
});
@hellobrian
hellobrian / put-pokemon.js
Created June 17, 2015 04:09
PUT request for pokemon.js
var request = require('request');
var fs = require('fs');
var pokemonjson = require('./pokemon.json');
var Pokemon = require('./app/models/pokemon.js');
// db.pokemons.update({}, {$unset: {sprites: ""}}, {multi: true, safe: true});
for (var i=600; i < 718; i++) {
var typesArray = [];
var spriteUrl = 'http://pokeapi.co/media/img/'+ pokemonjson[i].national_id +'.png';
@hellobrian
hellobrian / SassMeister-input-HTML.html
Created July 24, 2015 15:27
Generated by SassMeister.com.
<button class="bx-btn--primary">
primary button
</button>
///////////////////////
// Requires
///////////////////////
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
///////////////////////
// Tasks
@hellobrian
hellobrian / Vanilla-JavaScript-Tabs-with-visibility-hidden-visible.markdown
Last active October 25, 2015 00:03
Vanilla JavaScript Tabs with visibility hidden/visible