Skip to content

Instantly share code, notes, and snippets.

View ericdouglas's full-sized avatar

Eric Douglas ericdouglas

View GitHub Profile
@ericdouglas
ericdouglas / git.md
Created August 11, 2015 19:54
Git cheatsheet

git checkout -: Return to the last branch

@ericdouglas
ericdouglas / linux-cheatsheet.md
Last active October 14, 2016 14:03
Linux (Mint) Shortcuts

Window

  • alt+F7: move the screen with arrow keys. ps: shift + arrow go to the end of the screen
  • alt+F8: resize the screen with arrow keys.
  • alt+F10: toggle screen size (max and custom size)
  • ctrl+alt+up-arrow: see all workspaces
  • ctrl+alt+down-arrow: see all windows that are open in the current workspace
  • ctrl+alt+[left|right]-arrow: move to the next/previous workspace
  • grab window with mouse and move to the extremities resize the window in a half or a quarter of the total screen size
  • xdpyinfo | grep 'dimensions:': Use xdpyinfo command to find out current screen resolution
@ericdouglas
ericdouglas / vim.md
Last active June 28, 2019 17:42
Vim cheat sheet

Vim cheatsheet

Positioning

  • ctrl + d = down the file
  • ctrl + u = up the file
  • ctrl + f = positioning the ((current line || last visible line) - 1) at the top of the screen
  • ctrl + b = positioning the ((current line || first visible line) + 1) at the bottom of the screen
  • H M L = Move to the top/middle/bottom of the screen (i.e. High/Middle/Low)
  • '' = Jump back to where you just were. Could jump back and forth
@ericdouglas
ericdouglas / book-data.js
Last active August 29, 2015 14:23
Book generator for MongoDB data
var books = [];
for ( var i = 0; i <= 15; i += 1 ) {
books.push({
book : 'Book ' + i,
createdOn : new Date( 2015, i, 13 )
});
if ( i % 5 === 0 ) {
@ericdouglas
ericdouglas / exercise.js
Created June 10, 2015 23:24
Get the third and 5th letter of each string in an array of strings
var strings = [ 'Toggl', 'really', 'amazing', 'awesome' ];
console.log( getStrings( strings ));
///////////// Methods
function getStrings( strings ) {
/*
*
@ericdouglas
ericdouglas / access-inheritance.js
Last active August 29, 2015 14:22
Objects in JavaScript - Reminders
// inheritance of access properties
// using the guitar object above
var musicman = Object.create( guitar );
musicman.cost = 4000;
console.log( 'MusicMan' );
console.log( musicman.priceUS );
// 4000
console.log( musicman.priceBR );
@ericdouglas
ericdouglas / p.html
Last active August 29, 2015 14:22
Criando Formulários com AngularJS
<p ng-show="formName.inputName.$error.minlength"
class="help-block">
Senha muito curta!
</p>
@ericdouglas
ericdouglas / introrx.md
Last active August 29, 2015 14:22 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@ericdouglas
ericdouglas / zsh.md
Last active August 29, 2015 14:15 — forked from tsabat/zsh.md
@ericdouglas
ericdouglas / objects.js
Created January 30, 2015 10:02
Creating multiples objects from a map
function _populate( data ) {
var fields = [];
for ( key in data ) {
var obj = {};
obj[ key ] = data[ key ];
fields