Skip to content

Instantly share code, notes, and snippets.

View ordinz's full-sized avatar
🌴
deploying things

Ordin ordinz

🌴
deploying things
View GitHub Profile
@ordinz
ordinz / capybara_spec.rb
Created April 4, 2022 09:06
Rails Capybara has class
css_class = 'hello'
script = "document.querySelector('#{query}').classList"
expect(page.evaluate_script(script)).to have_text(css_class)
@ordinz
ordinz / modal_controller.js
Created March 19, 2021 07:46
Extend Modal from "tailwindcss-stimulus-components"
import {Modal} from "tailwindcss-stimulus-components"
export default class extends Modal {
connect(){
this.element[this.identifier] = this
this.toggleClass = 'hidden'
}
}
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
alias pwdc="pwd | pbcopy"
alias redotfile="cd ~; rm -rf dotfiles/; git clone https://github.com/lukelove/dotfiles.git && cd dotfiles && source bootstrap.sh"
@ordinz
ordinz / expose_http.sh
Created December 7, 2018 21:11
Open up a HTTP connection from the current directory
expose_http(){
PORT=8000
URL=http://`hostname`:$PORT
echo
echo Caution: Opening hole to the void.
echo
echo Exposing `pwd` to $URL
echo
{
sleep 1
@ordinz
ordinz / dark.md
Created November 14, 2018 19:24 — forked from a7madgamal/dark.md
Dark mode for Slack on MacOS
  1. Close slack
  2. Open this file /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
  3. Append this to it
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css',
   success: function(css) {
 $("").appendTo('head').html(css);
@ordinz
ordinz / gist:7455979
Created November 13, 2013 20:37
Update boxen and rbenv, install jruby-1.7.6
> cd /opt/boxen/repo/
> git pull origin master
> source /opt/boxen/env.sh
> rbenv install juby-1.7.6
alias gf="git diff"
alias ga="git add"
alias gc="git commit"
alias go="git checkout"
alias gb="git branch"
alias gbo="git checkout -b $1"
Failures:
1) Mpx::Media extraction of single item should transform the raw record and provide only relevant keys
Failure/Error: @media = Mpx::Media.new
NameError:
uninitialized constant Mpx::Authentication::Typhoeus
# ./lib/mpx/authentication.rb:11:in `authenticate'
# ./lib/mpx/media.rb:7:in `initialize'
# ./spec/lib/mpx/media_spec.rb:7:in `(root)'
# ./spec/lib/mpx/media_spec.rb:6:in `(root)'
'use strict';
describe('iFestivus Factories', function(){
describe('"Fest" Factory', function(){
beforeEach(
module('iFestivus')
);
ig.module('game.entities.man')
.requires('impact.entity')
.defines( () ->
EntityMan = ig.Entity.extend({
size: {x: 16, y: 24},
collides: ig.Entity.COLLIDES.NEVER,
animSheet: new ig.AnimationSheet('/media/player.png', 16, 24),
init: (x, y, settings) ->
})