Skip to content

Instantly share code, notes, and snippets.

View traumverloren's full-sized avatar
👀
Looking for new job...

Stephanie traumverloren

👀
Looking for new job...
View GitHub Profile
@traumverloren
traumverloren / browser-sync.md
Created December 26, 2016 14:50
using browser-sync

Serve and watch for changes in a directory.

$ browser-sync start --directory --server --directory --files

@traumverloren
traumverloren / pi_headless_setup.md
Last active December 9, 2016 02:24
Pi Headless Setup

Console Cable Setup:

  • The red lead should be connected to 5V if you want to power via the cable, see below for details
  • The black lead to GND (3rd pin down)
  • The white lead to TXD on the Pi (4th pin down)
  • The green lead to RXD on the pI (5th pin down)

schema

How to setup Pi to wireless using the console cable (headless):

@traumverloren
traumverloren / git-tips.md
Last active January 3, 2019 14:12
Git tips

To rename a branch:

git branch -m NEW_NAME

Or, if you are on a different branch:

git branch -m old-name new-name

Wanna delete the old-name remote branch and push the new-name local branch?
@traumverloren
traumverloren / rails-notes.md
Last active April 29, 2020 12:13
Rails notes

Setup ruby on rails:

https://gorails.com/setup/osx/10.15-catalina

Running Postgresql

To migrate existing data from a previous major version of PostgreSQL run: brew postgresql-upgrade-database

To have launchd start postgresql now and restart at login: brew services start postgresql

@traumverloren
traumverloren / create_indexes.md
Created August 11, 2016 14:24
create mongoid indexes

$ rake db:mongoid:create_indexes or you can do it at compose.io too...

@traumverloren
traumverloren / 0_reuse_code.js
Created July 4, 2016 12:05
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

import/export: tbd

object destructuring: tbd

const/let/var:

const/let are block scoped (meaning anywhere we have an opening and closing curly brace we're creating a new scope).

It's generally agreed upon that block scope is a better paradigm than function scope which is why organizations like Mozilla have been primarily using let internally for years. Now that brings us to const. Everything let has, const also has. The only difference is that when you create a variable with const, that variable can't be re-assigned a new reference. Notice I didn't say that variable is immutable.

@traumverloren
traumverloren / curl-calls.md
Last active September 10, 2020 16:31
How to curl in a Rails API

How to Use cURL to Test Rails controller actions:

-X [action]:
  • Allows you to specify an HTTP action such as GET, POST, PUT or DELETE.

  • Example:
    curl -X DELETE 'http://accounting.dev/v1/refunds/1'

-d [parameter]:
@traumverloren
traumverloren / docker-tips.md
Last active June 22, 2016 14:10
Getting up and running with Docker
@traumverloren
traumverloren / react_initial_steps.md
Last active July 9, 2016 09:02
Setup a new React project & Hello world component. Using ES6, webpack, babel (include stage3 for await/async)

Package.json

  • Create package.json file:
$ npm init

Setup Dependencies

  • Install initial dependencies:
$ npm install --save react react-dom && npm install --save-dev html-webpack-plugin webpack webpack-dev-server babel-{core,loader} babel-preset-react