| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
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 q = require('q'); | |
| if (debug) { | |
| q.onerror = function(err) { | |
| console.log(err); // auto-links source map refs in stack trace | |
| }; | |
| } | |
| somePromiseThatThrowsAnError | |
| .then(function() { /* do stuff */ }) |
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 hex2a(hex) { | |
| var str = ''; | |
| for (var i = 0; i < hex.length; i += 2) | |
| str += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); | |
| return str; | |
| } | |
| //Raw cookie | |
| var cookie = "B417B464CA63FE780584563D2DA4709B03F6195189044C26A29770F3203881DD90B1428139088D945CF6807CA408F201DABBADD59CE1D740F853A894692273F1CA83EC3F26493744E3D25D720374E03393F71E21BE2D96B6110CB7AC12E44447FFBD810D3D57FBACA8DF5249EB503C3DFD255692409F084650EFED205388DD8C08BF7B941E1AC1B3B70B9A8E09118D756BEAFF25834E72357FD40E80E76458091224FAE8"; |
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
| //Define a function scope, variables used inside it will NOT be globally visible. | |
| (function () { | |
| var | |
| //the HTTP headers to be used by all requests | |
| httpHeaders, | |
| //the message to be shown to the user | |
| message, |
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
| alias server='open http://localhost:8000 && python -m SimpleHTTPServer' | |
| alias tree='find . -print | sed -e "s;[^/]*/;|____;g;s;____|; |;g"' | |
| # http://mac.tutsplus.com/tutorials/terminal/speed-up-your-terminal-workflow-with-command-aliases-and-profile/ | |
| # The alias that takes me here - to editing these very aliases | |
| alias edit_profile="open -e ~/.bash_profile" | |
| # This alias reloads this file | |
| alias reload_profile='. ~/.bash_profile' |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Test</title> | |
| <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0/css/bootstrap.min.css"> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <h1>Test page</h1> |
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
| // I was unhappy about there was close to no control over the "pageControl" | |
| // in scrollableViews, so I hacked my own | |
| // ----- | |
| // Configuration | |
| var pageColor = "#c99ed5"; | |
| PagingControl = function(scrollableView){ | |
| var container = Titanium.UI.createView({ | |
| height: 60 |
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
| window.onerror = function(message, url, line_num) { | |
| // Standard error information | |
| var error = '\n JS Error: ' + message + ' from ' + url + ':' + line_num; | |
| error += '\n URL: ' + document.URL; | |
| // User agent info, using https://github.com/caseyohara/user-agent | |
| var user_agent = new UserAgent(); | |
| error += '\n Browser: ' + user_agent.browser_name + ' ' + user_agent.browser_version + ' | OS: ' + user_agent.os + ' | Platform: ' + user_agent.platform; |
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
| // All windows needed by controller | |
| var MessageWindow, app = require('/common/globals'); | |
| /** | |
| * constructor | |
| */ | |
| exports.MessageController = function(messageWindow) { | |
| MessageWindow = messageWindow; | |
| app.GlobalUpdate("messageController", this); |
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 _errs=["##EC##"]; | |
| window.onerror=function(){_errs.push(arguments)}; | |
| (function(f,n){function r(d,a){d=d.contentWindow||d.contentDocument;d.document&&(d=d.document);d.open();d.write(a);d.close()}function s(d,a){a=(""+a).replace(/</g,"<").replace(/>/g,">").replace(/'/g,""");return"<input type='hidden' name='"+d+"' value='"+a+"' />"}function o(d){l&&clearTimeout(l);l=setTimeout(t,200);d._when=p;q.push(d);try{if("ot"==m){for(var a,h=d.callee,e=/function\s*([\w\-$]+)?\s*\(/i,c=[],b,k;h&&10>c.length;)b=e.test(h.toString())?RegExp.$1||"{anonymous}":"{anonymous}", | |
| k=Array.prototype.slice.call(h.arguments||[]),c[c.length]=b+"("+i(k)+")",h=h.caller;a=c.join("\n");d._stack=a}}catch(g){}}function t(){var d=[],a,b,e,c,f=0,k,g=function(a,c){d.push(s(a+f,c))};try{for(;a=q.shift();){b=k=a.m||a[0]||a;e=a.u||a[1];c=a.l||a[2];if(!(k&&k instanceof Error)&&b&&"string"==typeof b&&e&&c&&("Error loading script"===b&&/Firefox/.test(navigator.userAgent)||/originalCreateNotification/.test(b)?f--:(g("type","onerr"),g("mes |
NewerOlder