Skip to content

Instantly share code, notes, and snippets.

View waldrupm's full-sized avatar
👋
Senior Full Stack Developer

M waldrupm

👋
Senior Full Stack Developer
View GitHub Profile
@waldrupm
waldrupm / capybara cheat sheet
Created August 29, 2022 15:33 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@waldrupm
waldrupm / _flash.html.erb
Created August 17, 2022 15:12
Flash pasted code - LevelUpTuts Rails course
<div class="rounded-md bg-green-50 p-4" role="alert">
<p class="text-sm font-medium text-green-800">
<%= flash[:notice] %>
</p>
</div>
<div class="rounded-md bg-red-50 p-4 mt-4" role="alert">
<p class="ml-3 text-sm font-medium text-red-800">
<%= flash[:alert] %>
</p>
</div>
@waldrupm
waldrupm / _navbar.html.erb
Last active August 17, 2022 15:12
Navbar Code for LevelUpTuts Rails Course
<header class="mb-4">
<nav class="flex flex-wrap items-center justify-between px-3 py-3 text-gray-700 bg-gray-100 lg:px-10">
<div class="flex items-center mr-6 flex-no-shrink">
<a href="#" class="link text-xl tracking-tight font-black">Eventz</a>
</div>
<div class="block lg:hidden">
<button class="flex items-center px-3 py-2 border border-gray-500 rounded text-grey hover:text-gray-600 hover:border-gray-600">
<svg class="w-3 h-3 fill-current" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><title>Menu</title><path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"/></svg>
</button>
</div>
@waldrupm
waldrupm / .zshrc
Created November 19, 2021 21:36
ZSH touch2 function - mkdir and touch in one
function touch2() {
mkdir -p "$(dirname "$1")" && touch "$1";
}
import React, { Component } from "react";
import { Route, Switch, Redirect } from "react-router-dom";
import "./css-build.css";
import Navbar from "./components/Navbar";
import Home from "./views/Home";
import Search from "./views/Search";
import Watchlist from "./views/Watchlist";
import SingleMovie from "./views/SingleMovie";
import firebase from "firebase";
import { firebaseApp } from "./firebase";
@waldrupm
waldrupm / answer.py
Created June 11, 2020 23:42
First non-repeating solution
def firstUniqChar(self, s):
wordlist = list(s)
# iterate over the string
for idx, letter in enumerate(wordlist):
current_letter = wordlist.pop(idx)
if current_letter in wordlist:
wordlist.insert(idx, current_letter)
else:
return idx
@waldrupm
waldrupm / main.css
Created June 4, 2020 19:55
Page structure
/* Include this somewhere in your main.css for the background iamge */
body {
background-image: url(images/nza_background.jpg);
}
.pad-sidebar {
padding-left: 30px;
}
@waldrupm
waldrupm / .babelrc
Created August 4, 2019 16:47
Solution to Babel / Webpack hoisting of async functions, causing RegeneratorRuntime errors.
{
"presets": [
["@babel/env",{"targets": {"node": "current"}}],
],
"plugins": [
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties"
]
}