Skip to content

Instantly share code, notes, and snippets.

View guilhermedecampo's full-sized avatar
👩‍🚀
Lets go 🚀

Guilherme Decampo guilhermedecampo

👩‍🚀
Lets go 🚀
View GitHub Profile
@guilhermedecampo
guilhermedecampo / multiple-push-urls.md
Created February 1, 2019 12:24 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@guilhermedecampo
guilhermedecampo / learning.md
Last active January 7, 2017 23:42 — forked from sibelius/learning.md
Learning Path React Native

Basics

  • Learn how to start a new react native project
  • Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
  • Learn how to upgrade a react native project
  • Learn how to add a package to the project
  • Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS

Learn Navigation

@guilhermedecampo
guilhermedecampo / iterm2.md
Created November 20, 2016 19:22
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

function agg_session_count(){
db.logs.mapReduce(
function(){
var local_zone = new Date().getTimezoneOffset()
var br_zone = 3*60;
var date_br = parseInt(this.when)+(br_zone-local_zone)*60;
var date = new Date(date_br*1000);
var date_format = date.getFullYear()+"-"+date.getMonth()+"-"+date.getDate();
emit(date_format,{event_ids: [this.event_id], count: 1});
packages:
yum:
git: []
files:
/opt/elasticbeanstalk/hooks/appdeploy/pre/51install_meteor.sh:
mode: "000755"
user: root
group: root
encoding: plain
HelpRequests = new Meteor.Collection('helpRequests', {
transform: function (doc) {
doc.isCancelled = function () {
return _.contains(['cancel-requester', 'cancel-helper'], this.status);
}
return doc;
}
});

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after