Skip to content

Instantly share code, notes, and snippets.

View imjul1an's full-sized avatar

Julian U. imjul1an

View GitHub Profile
@rhalukongor
rhalukongor / .spacemacs
Last active September 14, 2017 10:12
Use ESLint from project folder
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory

This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
@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])) {
@k0emt
k0emt / create_replica_set.bat
Last active November 20, 2016 18:16
Helper batch file for starting up a replica set named m101. Drop the --logpath option if you want to enjoy the log text flying by in the console. The --oplogSize option is the magic sauce to avoid creation of numerous 512MB+ files up to 5% of disk space.
mkdir \data\rs1 \data\rs2 \data\rs3
start mongod --replSet m101 --logpath "1.log" --dbpath \data\rs1 --port 27017 --smallfiles --oplogSize 64
start mongod --replSet m101 --logpath "2.log" --dbpath \data\rs2 --port 27018 --smallfiles --oplogSize 64
start mongod --replSet m101 --logpath "3.log" --dbpath \data\rs3 --port 27019 --smallfiles --oplogSize 64
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active June 9, 2024 23:19
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@fatihacet
fatihacet / pubsub-simple.js
Created October 15, 2011 22:02
Simple PubSub implementation with JavaScript - taken from Addy Osmani's design patterns book -
var pubsub = {};
(function(q) {
var topics = {}, subUid = -1;
q.subscribe = function(topic, func) {
if (!topics[topic]) {
topics[topic] = [];
}
var token = (++subUid).toString();
topics[topic].push({
token: token,