Skip to content

Instantly share code, notes, and snippets.

View scmx's full-sized avatar

Albert Arvidsson scmx

View GitHub Profile
@johnste
johnste / bookmarklets.html
Last active January 9, 2025 08:57
Useful bookmarklets
<h1>Useful bookmarklets</h1>
<ul>
<li><a href="javascript:(function() { const urls = ['http://localhost:3000', 'https://produktion.com']; const defaultURL = urls[0];const currentOrigin = window.location.origin;const currentIndex = urls.indexOf(currentOrigin);const nextURL = currentIndex === -1 ? defaultURL : urls[(currentIndex + 1) % urls.length];window.open(window.location.href.replace(currentOrigin, nextURL));})()">Open the current URL but in a different environments</a></li>
<li><a href="javascript:(function() { const selector=prompt('Selector','.');const all=document.querySelectorAll(selector);console.log(all),[...all].map((e=>e.classList.add('debug-outline')));var newScript=document.createElement('style'),content=document.createTextNode('.debug-outline { outline: 1px solid #f0f; }');newScript.appendChild(content);var bodyClass=document.getElementsByTagName('head')[0];bodyClass.insertBefore(newScript,bodyClass.childNodes[2]),window.speechSynthesis.speak(new SpeechSynthesisUtterance(`${all.length} found`
@alex-ross
alex-ross / Gemfile
Last active December 26, 2018 20:18
Nanobox + Capybara + Rails + RSpec
# Gemfile
group :development, :test do
gem 'rspec-rails'
gem "capybara"
gem "selenium-webdriver"
end
@JoshCheek
JoshCheek / christmas-tree.rb
Last active June 21, 2017 09:12
A bunch of command-line progrmas for a blog
require 'io/console'
height, width = $stdout.winsize
clear_screen = "\e[1;1H\e[2J"
bg_colour = "\e[40m"
tree_colour = "\e[42m"
base_height = 3
# Go into raw mode so users can enter 1 character at a time
$stdin.raw!