Skip to content

Instantly share code, notes, and snippets.

@BenGitsCode
BenGitsCode / .gitconfig-for-diffmerge
Created February 16, 2017 15:16 — forked from YanhaoYang/.gitconfig-for-diffmerge
Using DiffMerge as your Git visual merge and diff tool on Mac
[diff]
tool = diffmerge
[difftool "diffmerge"]
cmd = diffmerge \"$LOCAL\" \"$REMOTE\"
[merge]
tool = diffmerge
[mergetool "diffmerge"]
cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\""
trustExitCode = true
@BenGitsCode
BenGitsCode / es6-epic-logging.js
Created February 8, 2017 17:11
Great way to log objects with <the thing is: the thing>
`console.log({min});`
// it will output with the variable name like this `Object {min: 46}`
@BenGitsCode
BenGitsCode / ruby-review.rb
Last active February 7, 2017 21:11
Ruby basics review code
# Stores can sell things
class Store
def sell
'You bought the thing!'
end
end
# contains methods common to hot drinks
module HotDrink
# this defines an instance method make_hot_drink
@BenGitsCode
BenGitsCode / filter-forEach-chaining.js
Created February 7, 2017 19:50
Chaining array methods (filter and forEach)
let someArray = [1,2,3,4,5];
someArray
.filter(num => {
if(num % 2 === 0) {
return num;
}
})
.forEach(evnNum => {
//do something cool
// push to an array or something
@BenGitsCode
BenGitsCode / gist:a6993ad84edddd1b4c7111ed0d1b3c6b
Created February 7, 2017 19:31 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@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()
@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 / 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 / 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 / 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,
})