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 / app.js
Last active August 29, 2015 14:16
How to store API Keys in node process?
// ./app.js
// My GitHub API credentials are all hardcoded in a credentials.js file
var credentials = require('./credentials');
var GITHUB_CLIENT_ID = credentials.github.id;
var GITHUB_CLIENT_SECRET = credentials.github.secret;
var CALLBACK_URL = credentials.github.callback;
@hellobrian
hellobrian / app.js
Created March 10, 2015 02:37
user and gitub auth
var express = require('express')
, https = require('https')
, cookieParser = require('cookie-parser')
, cons = require('consolidate')
, bodyParser = require('body-parser')
, path = require('path')
, extend = require("extend")
, Cloudant = require('cloudant')
, session = require('express-session')
, url = require('url')
@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';

Pokeball CSS Animation

Animating a pokeball with CSS @keyframe animations. Pokeball is drawn with HTML markup.

A Pen by Brian Han on CodePen.

License.