Skip to content

Instantly share code, notes, and snippets.

function getImportsFromFile(fileName) {
const readline = require('readline');
const fs = require('fs');
const imports = [];
return new Promise((resolve, reject) => {
const readStream = fs.createReadStream(fileName);
readStream.on('error', (err) => reject(err));
const rl = readline.createInterface({input: readStream});
@scopevale
scopevale / tmux.cheat
Created June 1, 2017 08:40 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@scopevale
scopevale / gist:7170e01d5327dd47105b
Created February 3, 2016 14:31 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@scopevale
scopevale / .agignore
Created December 8, 2015 09:05 — forked from fallwith/.agignore
The Silver Searcher ~/.agignore file
/log/
/logs/
/images/
/javascripts/
/stylesheets/
/tmp/
/vendor/
*.sql
*.tags*
*.gemtags*

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@andre487
andre487 / ramda-promises.js
Created September 8, 2015 10:29
Ramda promises
var Fs = require('fs');
var Http = require('q-io/http');
var Q = require('q');
var R = require('ramda');
var readFile = R.composeP(R.toString, R.partial(Q.ninvoke, Fs, 'readFile'));
var readPackageInfo = R.composeP(JSON.parse, readFile, R.partial(Q, 'package.json'));
var homePageFromAuthor = R.compose(R.propOr('', 1), R.match(/.+?\((.+?)\)$/), R.prop('author'));
// This is the equivalent of the old waitsFor/runs syntax
// which was removed from Jasmine 2
waitsForAndRuns = function(escapeFunction, runFunction, escapeTime) {
// check the escapeFunction every millisecond so as soon as it is met we can escape the function
var interval = setInterval(function() {
if (escapeFunction()) {
clearMe();
runFunction();
}
}, 1);
@scopevale
scopevale / inview.js
Last active August 29, 2015 14:20 — forked from defx/inview.js
function inView(el, fn) {
var location, size;
el.getCssValue('display')
.then(function (display) {
if (display === 'none') {
fn(false);
} else {
return el.getSize()
@LinusU
LinusU / README.md
Last active July 17, 2021 08:06 — forked from apla/icons_and_splash.js
Icons and Splash images for your Cordova project. (with iOS 7 support)

Usage

Install cordova into node_modules

npm install cordova

Add icons_and_splash.js

@ebidel
ebidel / Web Components Resources.md
Last active October 12, 2024 17:10
List of resources related to Web Components