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 / gulp
Last active August 29, 2015 14:09
gulp
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var sass = require('gulp-sass');
var webserver = require('gulp-webserver');
var autoprefixer = require('gulp-autoprefixer');
var sourcePaths = {
styles: ['scss/**/*.scss']
};
@hellobrian
hellobrian / sublime settings
Created December 8, 2014 19:21
My user-settings in Sublime Text 3
{
"color_scheme": "Packages/Theme - Cobalt2/cobalt2.tmTheme",
"font_size": 15,
"ignored_packages":
[
"HTML",
"CSS",
"Vintage",
"GitGutter"
],
@hellobrian
hellobrian / meteor-login_buttons.html
Last active August 29, 2015 14:11
meteor/accounts-ui-unstyled
<template name="loginButtons">
<div id="login-buttons" class="login-buttons-dropdown-align-{{align}}">
{{#if currentUser}}
{{#if loggingIn}}
{{! We aren't actually logged in yet; we're just setting Meteor.userId
optimistically during an at-startup login-with-token. We expose this
state so other UIs can treat it specially, but we'll just treat it
as logged out. }}
{{#if dropdown}}
{{> _loginButtonsLoggingIn }}
@hellobrian
hellobrian / gist:9c5557e3055e83681035
Last active August 29, 2015 14:13
bluemix server.js express
// Import Node module packages
var express = require('express');
// Invoke express app
var app = express();
// Commented code is for express router and hbs templates
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/', { extensions: ['html'] }));
// var hbs = require('express-handlebars');
// var path = require('path');
var router = express.Router();
@hellobrian
hellobrian / gulpfile.js
Last active August 29, 2015 14:14
bluemix boilerplate
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
var reload = browserSync.reload;
// browser-sync task for starting the server.
// this task will start a static server from the root directory
<section class="solution-top">
<h1 class="copy-text">{@i18n t="cognitive:cognitive_title"/}</h1>
<p class="copy-statement">{@i18n t="cognitive:cognitive_desc"/}</p>
{^hideSignUp}
<a class="get-started" href="https://apps.admin.ibmcloud.com/manage/trial/bluemix.html">{@i18n t="cognitive:getstartedfree_button"/}</a>
{/hideSignUp}
</section>
@hellobrian
hellobrian / cf logs leaderboard --recent
Last active August 29, 2015 14:15
deploying meteor leaderboard to stage1 bluemix
2015-02-11T01:20:16.87-0600 [API] OUT Created app with guid 61bfd7f1-2ecd-4fda-a882-f8864c5c0827
2015-02-11T01:20:21.80-0600 [API] OUT Updated app with guid 61bfd7f1-2ecd-4fda-a882-f8864c5c0827 ({"route"=>"5280145f-a4b6-4e3c-bd78-cfac9e0a8d6b"})
2015-02-11T01:31:07.44-0600 [DEA] OUT Got staging request for app with id 61bfd7f1-2ecd-4fda-a882-f8864c5c0827
2015-02-11T01:31:14.04-0600 [STG] ERR Cloning into '/tmp/buildpacks/bluemix-bp-meteor'...
2015-02-11T01:31:14.68-0600 [STG] OUT -----> Resolving engine versions
2015-02-11T01:31:14.69-0600 [STG] OUT No version of Node.js specified in nodeversion, using '0.10.33'
2015-02-11T01:31:20.02-0600 [STG] OUT Using Node.js version: 0.10.33
2015-02-11T01:31:20.04-0600 [STG] OUT -----> Fetching Node.js binaries
2015-02-11T01:31:20.97-0600 [STG] OUT -----> Installing jsontool with npm
2015-02-11T01:31:21.81-0600 [STG] OUT npm WARN deprecated jsontool@7.0.2: jsontool is now called simply 'json'. Please update yo
@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')