Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| #include <vector> | |
| #include <cstdlib> | |
| #include <iostream> | |
| #include <iomanip> | |
| #include <string> | |
| using namespace std; | |
| typedef long long LL; | |
| // base and base_digits must be consistent | |
| const int base = 1000000000; | |
| const int base_digits = 9; |
| # using libfaac on Mac OS X 10.6.8 | |
| # -vn : not copying video | |
| # -acodec : specify codec used in flv file | |
| # -ac : channels. 1 is for mono, 2 is for stereo | |
| # -ab : specify bitrate for output file (note that rate is not kbps but bps) | |
| # -ar : sampling frequency (Hz) | |
| # -threads: number of threads for encoding | |
| # "-strict experimental" is necessary to use libfaac | |
| ffmpeg -y -i xxxxxxxxxxx.flv -vn -acodec aac -ac 2 -ab 128000 -ar 44100 -threads 4 -strict experimental xxxxx.m4a |
| #include <iostream> | |
| #include <unordered_map> | |
| #include <list> | |
| #include <stdexcept> | |
| template <typename K, typename V> | |
| class lru_cache { | |
| private: | |
| typedef std::pair<K, V> cache_entry; | |
| typedef std::list<cache_entry> cache_list; |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| <!-- Respect Rollcall --> | |
| <li><a href="http://www.alistapart.com/articles/">A List Apart — for website builders</a></li> | |
| <li><a href="http://abstrusegoose.com/">Abstruse Goose — my favorite comic</a></li> | |
| <li><a href="http://al3x.net/">Alex Payne — technology rambling</a></li> | |
| <li><a href="http://dashes.com/anil/">Anil Dash — on culture, apple & design</a></li> | |
| <li><a href="http://weblogs.mozillazine.org/asa/">Asa Dotzler — on mozilla & software</a></li> | |
| <li><a href="http://www.azarask.in/blog/">Aza Raskin – on design & firefox</a></li> | |
| <li><a href="http://christophzillgens.com/en/">Christoph Zillgens — interface design</a></li> | |
| <li><a href="http://cssremix.com/">CSS Remix — gorgeous designs</a></li> | |
| <li><a href="http://css-tricks.com/">CSS Tricks</a></li> |
| // FAST OUTPUT IS ENABLED ONLY WHEN 'ONLINE_JUDGE' IS DEFINED | |
| #include <cstdio> | |
| #include <iostream> | |
| using std::string; | |
| static struct IO { | |
| char tmp[1 << 10]; | |
| // fast input routines |
Since this is on Hacker News...
_t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".while loops because shut up, you're overthinking a joke.| var loopback = require('loopback'); | |
| module.exports = function(SampleModel) { | |
| // Returns null if the access token is not valid | |
| function getCurrentUserId() { | |
| var ctx = loopback.getCurrentContext(); | |
| var accessToken = ctx && ctx.get('accessToken'); | |
| var userId = accessToken && accessToken.userId; | |
| return userId; |
| function query() { | |
| var | |
| total = 0, shown = 0, | |
| // HN is done with very unsemantic classes. | |
| job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.c00,.c9c,.cdd,.c73,.c88')), | |
| query_list = Array.prototype.slice.call(arguments); | |
| // This traverses up the dom stack trying to find a match of a specific class | |
| function upTo(node, klass) { | |
| if (node.className === klass) { |
| # Boxstarter options | |
| $Boxstarter.RebootOk=$true # Allow reboots? | |
| $Boxstarter.NoPassword=$false # Is this a machine with no login password? | |
| $Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot | |
| Disable-UAC |