This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getKeys(obj, keys) { | |
| keys = keys || {}; | |
| Object.keys(obj).forEach(function(k){ | |
| if (!k in keys) { | |
| var o = obj[k]; | |
| keys[k] = 1; | |
| if (typeof o === 'Object') { | |
| getKeys(o,keys); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| auto _Folder = Windows::Storage::ApplicationData::Current->LocalFolder; | |
| auto _Option = Windows::Storage::CreationCollisionOption::ReplaceExisting; | |
| // create file async | |
| _Folder->CreateFileAsync("MyFileName", _Option); | |
| // create file sync by wrapping in task - then pattern | |
| IAsyncOperation<StorageFile^>^ fileOp = _Folder->CreateFileAsync("MyFileName2", _Option); | |
| auto deviceEnumTask = create_task(fileOp); | |
| deviceEnumTask.then([](StorageFile^ myFile) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ti sdk | grep "\[selected\]" | awk '{print $1}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var w = Ti.UI.createWindow(); | |
| w.open(); | |
| w.backgroundColor = 'red'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var w = Ti.UI.createWindow(); | |
| var v = Ti.UI.createView({backgroundColor:'white'}); | |
| w.add(v); | |
| var t = Ti.UI.createLabel({text:'It works!'}); | |
| v.add(t); | |
| w.open(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // simple and quick port of | |
| // | |
| // find -E . -type f -not -regex "^\./\.git/.*" | awk 'BEGIN {FS="."} {tally[$NF]+=1} END {for (key in tally) {printf "%d: %s\n", tally[key], key}}' | sort -n -k 1,1 | tail -r | |
| // | |
| var wrench = require('wrench'), | |
| fs = require('fs'), | |
| path = require('path'), | |
| _ = require('lodash'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Helper Functions for Handlebars Templating engine | |
| */ | |
| var fs = require('fs'), | |
| path = require('path'), | |
| Arrow = require('arrow'); | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Arrow = require('arrow'); | |
| var API = Arrow.API.extend({ | |
| group: 'file', | |
| path: '/api/fileexample', | |
| method: 'POST', | |
| nickname: 'fileexample', | |
| description: 'Example for file upload', | |
| parameters: { | |
| file: {description:'file to publish', type:'body'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import url from 'url'; | |
| describe('Login', function() { | |
| it('cy.should - assert that <title> is correct', function() { | |
| cy.visit('http://localhost:5001'); | |
| cy.get('#login').should('contain', 'Login with Github'); | |
| cy.request({ | |
| url: '/login', | |
| followRedirect: false | |
| }) |