Skip to content

Instantly share code, notes, and snippets.

@ikennaokpala
ikennaokpala / nfs-vagrant-error.md
Last active March 8, 2024 12:54
Vagrant error :NFS is reporting that your exports file is invalid

Vagrant error :NFS is reporting that your exports file is invalid

==> default: Exporting NFS shared folders...
NFS is reporting that your exports file is invalid. Vagrant does
this check before making any changes to the file. Please correct
the issues below and execute "vagrant reload":

exports:2: path contains non-directory or non-existent components: /Users/<username>/path/to/vagrant
exports:2: no usable directories in export entry
exports:2: using fallback (marked offline): /
@gaearon
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@selaromi
selaromi / make-flashlight-work-on.yosemite.md
Last active July 25, 2023 19:21
Steps to make Flashlight work on 10.10.4 (doesn't work for El Capitan)

Make Flashlight work on 10.10.4

  1. Install SIMBL http://culater.net/software/SIMBL/SIMBL.php
  2. Copy SpotlightSIMBL.bundle to /Library/Application Support/SIMBL/Plugins/ (a)
  3. Copy Flashlight.osax to ~/Library/ScriptingAdditions/ (b)
  4. Disable Flashlight
  5. Enable Flashlight
  6. Open Script Editor on your Mac (look for "Script Editor In Spotlight") and paste the following code (don't change Snow Leopard for Yosemite)
tell application "Spotlight" to inject SIMBL into Snow Leopard
@adisuryadi
adisuryadi / compile.sh
Last active November 28, 2021 00:16
Run ES6/ES2016/ES2017 in Coderunner (using babel)
#!/bin/bash
#
# This script will transplie our code using babel and evaluates it using node.js
#
# Steps:
# 1) Install babel globally:
# npm install -g babel-cli
# or
# yarn global add babel-cli
# 2) Create a new language in Coderunner preferences (eg. Javascript (Babel)).
@rhulha
rhulha / gist:92bee42c35c970cce761
Created February 12, 2015 02:20
Wunderlist completed task remover written in Dart
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() {
var url = 'https://a.wunderlist.com/api/v1/';
var client_id = 'blabla';
var client = new http.Client();
client.post(url + "authenticate", body: {
"email": "bla@blabla.net",
@mlouro
mlouro / gulpfile.js
Last active June 21, 2022 23:20
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@jordanmoore
jordanmoore / Better Emmet Media Queries
Created November 18, 2013 10:08
Go to Preferences > Browse Packages > Emmet > Emmet.sublime-settings and add this between the curly brackets under snippets for writing better media queries quickly in Emmet. mqm => min-width media query mqx => max-width media query
"css": {
"abbreviations": {
"mqm": "@media screen and (min-width:${1}) {\n\t|\n}",
"mqx": "@media screen and (max-width:${1}) {\n\t|\n}"
}
}
@robballou
robballou / gist:3189989
Created July 27, 2012 19:23
Re-attaching Drupal behaviors to an element
// remove the ajax-processed class from the element so that
// attachBehaviors() will update the element
$('#my-element-id').removeClass('ajax-processed');
// now re-attach the behaviors to this element
Drupal.attachBehaviors($('#my-element-id'));