Skip to content

Instantly share code, notes, and snippets.

My Atom Config

Atom Editor Screenshot

Theme:

  • atom-dark-ui
  • atom-solarized-dark
  • plus custom styles.less rules
@BenGitsCode
BenGitsCode / 0_reuse_code.js
Created May 21, 2016 06:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@BenGitsCode
BenGitsCode / npm-upgrade-bleeding.sh
Created January 11, 2017 05:52 — forked from othiym23/npm-upgrade-bleeding.sh
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@BenGitsCode
BenGitsCode / .travis.yml
Created January 17, 2017 21:32
.travis.yml Javascript Unit CI Testing
language: node_js
node_js:
- '6'
before_script: # before running scripts
- 'npm install'
- 'npm install -g grunt-cli'
script: # run these scripts
- 'grunt nag'
- 'grunt test'
# whitelist
@BenGitsCode
BenGitsCode / remark-lint.sh
Created January 18, 2017 18:02
Run Remark lint (both verbose and shorthand)
(verbose)
remark README.md -u remark-lint -r ./.remarkrc
(shorthand)
remark <file>
@BenGitsCode
BenGitsCode / api-user.js
Created January 20, 2017 03:11
Scaffold Sample user AJAX requests
'use strict';
const app = require('../app-data');
const signIn = (success, failure, data) => {
$.ajax({
method: "POST",
url: app.server.api + '/sign-in',
data,
})
@BenGitsCode
BenGitsCode / events-user.js
Created January 20, 2017 03:12
Scaffold Sample User Click Handlers
'use strict';
const authApi = require('./api-user');
// const authApiNodes = require('./api-nodes'); Not being used ATM
const authUi = require('./ui-user');
const app = require('../app-data');
@BenGitsCode
BenGitsCode / ui-user.js
Created January 20, 2017 03:13
Scaffold Sample UI
'use strict';
const app = require('../app-data');
const apiNodes = require('./api-nodes.js');
const display = require('../display');
const authApi = require('./api-user');
const success = (data) => {
console.log(data);
};
@BenGitsCode
BenGitsCode / nvm-tmux-issue.md
Last active January 27, 2017 13:33
Record of nvm tmux oh-my-zsh issue

It Begins

  • Ran brew install tmux
  • npm, nvm, node stop working and I get the following error upon sourcing ~/.zshrc
 ✘ ~
〉 reload
/Users/Benjamski/.zshrc:source:91: no such file or directory: /usr/local/Cellar/nvm/0.33.0/nvm.sh
ZSH config reloaded from ~/.zshrc
 ~
@BenGitsCode
BenGitsCode / init.coffee
Created February 7, 2017 16:05 — forked from darklight721/init.coffee
An atom command and keymap to quickly end lines with semicolons. Only applies for javascript files. Code is based from turbo-javascript package.
# Open up your atom's init script file and add the following lines, then restart atom.
path = require 'path'
endLine = (insertNewLine) ->
editor = atom.workspace.activePaneItem
if path.extname(editor.getPath()) is '.js'
editor.getCursors().forEach((cursor) ->
editor.moveCursorToEndOfLine()
line = cursor.getCurrentBufferLine().trim()