THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| nnoremap <silent> y :<C-U>call MarkAndSetOpfunc()<CR>g@ | |
| vnoremap <silent> y :<C-U>call MarkYankAndJump()<CR> | |
| function! MarkAndSetOpfunc() | |
| let g:save_cursor = getpos(".") | |
| set opfunc=YankAndJumpBack | |
| endfunction | |
| function! MarkYankAndJump() | |
| let g:save_cursor = getpos(".") |
| var | |
| // Local ip address that we're trying to calculate | |
| address | |
| // Provides a few basic operating-system related utility functions (built-in) | |
| ,os = require('os') | |
| // Network interfaces | |
| ,ifaces = os.networkInterfaces(); | |
| // Iterate over interfaces ... |
Philosophy is a way of life and not just a theoretical discipline.
Epictetus (55 — 135 AD) was a Greek slave of Rome. He became a great Stoic philosopher and teacher, and was eventually freed.
Although he was a fatalist, he believed that individuals are responsible for their own actions, which they can examine and control through rigorous self-discipline.
| /** | |
| * Removes the minus sign from the beginning of the string | |
| * | |
| * @param str | |
| * @returns an array with the first item as true if a minus | |
| * was found and the string minus the minus sign. | |
| */ | |
| function stripSign(str) { | |
| // Check if it has a minus sign | |
| let hasMinus = str.charAt(0) === '-'; |
You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:
var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }
console.log(getN()); // 5
setN(10);
| " XDG Environment For VIM | |
| " ======================= | |
| " | |
| " References | |
| " ---------- | |
| " | |
| " - http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables | |
| " - http://tlvince.com/vim-respect-xdg | |
| " - https://gist.github.com/kaleb/3885679 (the original version) | |
| " |
| import java.io.FileDescriptor; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.io.PrintStream; | |
| public class HelloWorld{ | |
| private static HelloWorld instance; | |
| public static void main(String[] args){ | |
| instantiateHelloWorldMainClassAndRun(); |
NOTE: This guide has moved to https://github.com/bpierre/switch-to-vim-for-good
This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about how I switched myself.
My decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.
Original gist with comments: https://gist.github.com/bpierre/0a0025d348b6001394e0
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |