Skip to content

Instantly share code, notes, and snippets.

let mapleader = ","
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" OPEN FILES IN DIRECTORY OF CURRENT FILE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
cnoremap %% <C-R>=expand('%:h').'/'<cr>
map <leader>e :edit %%
map <leader>s :sp<cr>:edit %%
map <leader>v :vsp<cr>:edit %%
var weevil = require('weevil');
var deval = require('deval');
console.log('Lets do something that should be blocking:');
//this code will be run in a webworker
var worker = weevil(deval(function () {
var start = +new Date();
for (var i=0; i<10000000000000; i++) {
@latentflip
latentflip / gist:10743032
Created April 15, 2014 15:47
Possible ampersand-state presenter
var State = require('ampersand-state');
var _ = require('underscore');
function setupPresenterBindings (presenter) {
Object.keys(presenter._deps).forEach(function (dep) {
var parts = dep.split('.');
if (parts.length !== 2) return;
var presentee = parts[0];
var property = parts[1];
@latentflip
latentflip / techmeetup.md
Last active August 29, 2015 14:00
TechMeetup Edinburgh April 2014 Survey/Update

TechMeetup Edinburgh Update

I recently sent a short survey round about TechMeetup Edinburgh, and figured I should summarise some thoughts that came out of it.

A little background

For anyone who's not been around the tech scene in Edinburgh for ~6 years, TechMeetup was started by Sam Collins about 6 years ago to create a space to pull the wider Edinburgh tech & startup community together.

Since then, we've expanded to events in Glasgow, Dundee, Aberdeen and Inverness. And the Edinburgh event has cycled through a number of organisers in the last 6 years. Currently it's organised by myself and Marius.

@latentflip
latentflip / recurse.js
Last active August 29, 2015 14:03
This program asks the user to enter things, until they enter an empty string, when it finishes, printing the things they entered.
//This just sets up readline
var rl = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
function getThingsFromTheCommandLine(done) {
//rl.question asks for a prompt, and calls callback with the result
rl.question("Enter something: ", function (answer) {
if (answer.trim() === '') return done([]);
{
"asi": false,
"expr": true,
"loopfunc": true,
"curly": false,
"evil": true,
"white": true,
"undef": true,
"browser": true,
"trailing": true,
body
nav.navbar.navbar-default
div.container-fluid
div.navbar-header
a.navbar-brand(href='/') Wolves
ul.nav.navbar-nav(role="main-nav")
li
a(href='/howls') Howls
.container
main(role="page-container")
var AmpersandModel = require('ampersand-model');
var AmpersandCollection = require('ampersand-collection');
var Note = AmpersandModel.extend({
props: {
text: 'string'
}
});
var Notes = AmpersandCollection.extend({
@latentflip
latentflip / index.js
Created August 21, 2014 10:34
requirebin sketch
var Collection = require('ampersand-collection');
var MyCollection = Collection.extend({
initialize: function () {
this.listenTo(this, 'all', console.log.bind(console));
}
});
var myc = new MyCollection();
myc.add({ foo: 'bar' });
function canCalcVh() {
//If we don't have this, calc + vh probably won't work anyway.
if (!window.getComputedStyle) return false;
//Create a div element
var dummyDiv = document.createElement('div');
//Ensure it's not visible
dummyDiv.style.visibility = 'hidden';