Skip to content

Instantly share code, notes, and snippets.

@chalettu
chalettu / gist:740015e7aa31860f9987
Created October 23, 2014 16:49
Copy of ionic-header-bar
<ion-header-bar align-title="center" class="bar-positive">
<h1 class="title">Fast Start</h1>
<button class="button icon ion-log-out button-clear logout_button" ng-click="logout()"></button>
</ion-header-bar>
<ion-content style="top:75px;height: 100%;">
@chalettu
chalettu / gist:ab1d9ec881778b0cc31e
Created June 3, 2015 20:27
Barcode Scanner Sample
$scope.currentlyScanning=false;
$scope.loadScanner=function(){
// alert("loading barcode scanner");
if ($scope.currentlyScanning===true){
return;
}
else
@chalettu
chalettu / gist:2198bb6f37fa8e69c99f
Created June 10, 2015 20:53
sample code for angular route resolution
$urlRouterProvider.otherwise(function ($injector, $location) {
// console.log("loading main");
if ($location.$$url === '/') {
// $urlRouterProvider.otherwise('/');
// window.location = '/';
}
else {
console.log("passing to webserver to handle it");
// pass through to let the web server handle this request
window.location = $location.$$absUrl;
{
"name": "myapp",
"main": "app.js",
"version": "0.0.0",
"authors": [
"jessie <jessie@apollo.com.ph>"
],
"license": "MIT",
"private": true,
"ignore": [
Users.findOne({"id":user_id}).exec(function(err, user) {
stripe.customers.create({ //this saves the user to the platform account
source: tokenID,
email: user.email,
description: "Example customer"
}, function (err, customer) {
user.stripe_cust=customer.id;
//this attempts to create a token associated to the connected account id
stripe.tokens.create(
@chalettu
chalettu / gist:7b233ab136d1366fc1c54b7b17b395ce
Created October 7, 2016 22:37
Simple Example on how to specify version of node in a script
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash
nvm install 0.12.16
nvm use 0.12.16
@chalettu
chalettu / gist:06c981e32c0d8ad2a0ee9ff23701d27f
Created December 14, 2016 16:15
Unit test for component
describe('detail-reveal component', function() {
beforeEach(function(){
module('app.components', 'gettext');
});
describe('controller', function() {
var controller;
var $componentController;
var bindings = {title: 'Test', detail: 'test detail', icon: 'testIconClass', translateTitle: false, rowClass: 'test'};
@chalettu
chalettu / gist:b59b4dee08c80939b2d6f0e79e49c462
Created July 14, 2017 14:57
Conditionally loading cordova
// put this in your main.js
// add cordova.js only if serving the app through file://
if (window.location.protocol === 'file:' || window.location.port === '3000') {
var cordovaScript = document.createElement('script')
cordovaScript.setAttribute('type', 'text/javascript')
cordovaScript.setAttribute('src', 'cordova.js')
document.body.appendChild(cordovaScript)
}
@chalettu
chalettu / gist:ea14bbd67b3fe080b891762ac3478be3
Created September 12, 2017 13:22
Travis CI detect Commit messages
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip validator\]'; export TWBS_DO_VALIDATOR=$?; true
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip sauce\]'; export TWBS_DO_SAUCE=$?; true
install:
- time npm install -g grunt-cli
- ./test-infra/s3_cache.py download npm-modules
- if [ "$TWBS_TEST" = validate-html ] && [ $TWBS_DO_VALIDATOR -ne 0 ]; then ./test-infra/s3_cache.py download rubygems; fi
@chalettu
chalettu / gist:a253e89267bf25136766268d30678fa9
Created September 19, 2017 20:36
Creating Generic Object Definitions and Generic objects 400 Error
//Create Object Definition
POST - localhost:3000/api/generic_object_definitions
{
"name" : "LoadBalancer",
"description" : "LoadBalancer description",
"properties" : {
"attributes" : {
"address" : "string",
"last_restart" : "datetime"
},