Skip to content

Instantly share code, notes, and snippets.

View traumverloren's full-sized avatar
🐢

Stephanie traumverloren

🐢
View GitHub Profile
@traumverloren
traumverloren / peptalk.txt
Last active August 29, 2015 14:15
Pep talk
I know you've done everything possible to get to where you are in Ruby and in Dutch in a really short timeframe.
And no matter what anyone else says,
and no matter how anyone treats you,
you can know that you are putting the effort in,
and you've accomplished so much.
I'm more and more impressed every day.
Honestly, you've given me renewed drive to improve my development skills.
@traumverloren
traumverloren / doorkeeper.rb
Last active March 10, 2022 10:27
doorkeeper config for redirect back to client app after login with oauth2 provider
#########################
# config/initializers/doorkeeper.rb
#########################
Doorkeeper.configure do
# Change the ORM that doorkeeper will use.
# Currently supported options are :active_record, :mongoid2, :mongoid3, :mongo_mapper
orm :active_record
# This block will be called to check whether the resource owner is authenticated or not.
@traumverloren
traumverloren / rename_mongoid_collection.rb
Created January 25, 2016 12:17
How to rename a mongoid collection in 4.0.2
$ Mongoid::VERSION
=> "4.0.2"
$ Mongoid::Sessions.default[:delivery_addresses].rename(:banned_addresses)
=> {"ok"=>1.0}
@traumverloren
traumverloren / find_duplicates.rb
Created February 2, 2016 09:05
Find duplicates in MongoDB collection using Aggregate in Rails Console
results = Merchant.collection.aggregate([
{ "$group" => {
_id: { "confirmation_token" => "$confirmation_token"},
recordIds: {"$addToSet" => "$_id" },
count: { "$sum" => 1 }
}},
{ "$match" => {
count: { "$gt" => 1 }
}}
])
@traumverloren
traumverloren / webpack.config.js
Created February 7, 2016 19:49 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@traumverloren
traumverloren / switch-to-rbenv.md
Last active March 29, 2024 00:54
Switch from RVM to rbenv

Switch from RVM to rbenv:

Get Rid of RVM if it's installed:

rvm implode

Cleanup your .bash_profile/.bashrc/.zshrc file to remove RVM from the path:

You should have something like this left from RVM. Delete it from the file. ``[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"```

@traumverloren
traumverloren / how_to_curl.md
Created March 14, 2016 12:43
example curl call in terminal format
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@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
@traumverloren
traumverloren / docker-tips.md
Last active June 22, 2016 14:10
Getting up and running with Docker