Skip to content

Instantly share code, notes, and snippets.

View flanger001's full-sized avatar
🧱

David Shaffer flanger001

🧱
View GitHub Profile
@ankushagarwal
ankushagarwal / ruby tutorial.md
Last active August 29, 2015 13:57
Rubies and Rvm

Managing rubies and rvm on OSX

Get rid of rvm

Unistall rvm ( if there exists one )

rm -rf ~/.rvm

Fresh install rvm

@tibbon
tibbon / gist:2393556
Created April 15, 2012 15:57
Helping Dave S get started on Rails 3.x with Heroku
# This creates your rails site in the directory called 'davesite'. You can replace 'davesite' with anything that starts with a letter.
rails new davesite
#Change to the davesite directory.
cd davesite
#Logs you onto Heroku. You only really need to do this once unless you have multiple accounts
heroku login
@alexymik
alexymik / RetailMeNot Unsubscribe Python Script
Created September 12, 2020 02:25
Python script to unsubcribe an apartment building from RetailMeNot mail flyers. Requires AntiCaptcha API key
import cloudscraper
import pprint
import names
import time
UNSUBSCRIBE_URL = 'https://www.retailmenot.com/responsive/ajax/UnsubscribeMailerQueue.php'
APARTMENT_MAX_FLOOR = 6
APARTMENT_MAX_UNIT = 7
@jodosha
jodosha / benchmark.rb
Created July 22, 2020 07:37
Ruby Method Overloading
require "benchmark/ips"
require_relative "./method_overloading"
class Foo
include MethodOverloading
def call(number)
"foo #{number}"
end
end
@flanger001
flanger001 / mysql
Last active April 13, 2022 12:51
Installing MySQL on macOS
MySQL
If the mysql2 gem fails to install, be sure your Xcode Command Line Tools are installed:
$ xcode-select --install
Then try reinstalling the gem with either of these 3 commands:
$ gem install mysql2 -- \
--with-cflags=\"-I$(brew --prefix)/opt/openssl/include\" \
@jcasimir
jcasimir / render_and_redirect.markdown
Created September 11, 2011 21:29
Render and Redirect in Rails 3

Render and Redirect

The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render in a controller when we want to respond within the current request, and redirect_to when we want to spawn a new request.

Render

The render method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form' or render @post.comments, but here we'll focus on usage within the controller.

:action

@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@gbuesing
gbuesing / ml-ruby.md
Last active February 28, 2024 15:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems

@zkat
zkat / index.js
Last active March 10, 2024 14:32
npx is cool
#!/usr/bin/env node
console.log('yay gist')