Skip to content

Instantly share code, notes, and snippets.

View stephaniewilkinson's full-sized avatar
🐧

Stephanie stephaniewilkinson

🐧
View GitHub Profile
AllCops:
TargetRubyVersion: 2.5.1
EnabledByDefault: true
#################### Bundler ##############################
Bundler/DuplicatedGem:
Enabled: true
Bundler/OrderedGems:
@rambabusaravanan
rambabusaravanan / detect-js-framework.js
Last active July 8, 2024 05:24
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
@RobAWilkinson
RobAWilkinson / movie-tickets.clj
Last active September 14, 2016 18:08
Code wars recursion
; Description:
; My friend John likes to go to the cinema. He can choose between system A and system B.
; System A : buy a ticket (15 dollars) every time
; System B : buy a card (500 dollars) and every time
; buy a ticket the price of which is 0.90 times the price he paid for the previous one.
; Example:
; If John goes to the cinema 3 times:
@havenwood
havenwood / plain_text_jwt.rb
Created March 13, 2016 18:43
Unencrypted, plaintext JWTs in Ruby
require 'base64'
require 'json'
module PlainTextJWT
HEADER = Base64.strict_encode64({typ: 'JWT', alg: 'none'}.to_json)
HEADER_SIZE = HEADER.size
module_function
def encode payload
@stephaniewilkinson
stephaniewilkinson / gist:3a317103e9d3e10d98f5
Last active August 29, 2015 14:03
The Mobbing Manual

The mobbing manual provides guidelines for working in a group oriented context

Values

  • Kindness
  • Consideration
  • Respect

Roles

  • Driver Learning Goal: practice keyboarding, listening, and translation skills.
@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active July 10, 2024 00:17
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

@stevenharman
stevenharman / fork_db.sh
Last active May 17, 2024 21:20
Fork and promote one Heroku app's Postgres Database to another app.
#!/bin/sh
set -e
app=${1}
staging_app=staging-${app}
db_type=${2:-crane}
old_db=`heroku config -a ${staging_app} | grep ^HEROKU_POSTGRESQL | cut -d : -f 1 | sed s/_URL//`
heroku addons:add heroku-postgresql:${db_type} --fork `heroku config -a ${app} | grep ^DATABASE_URL | cut -d : -f 2-5` -a ${staging_app}
@tommct
tommct / README.md
Last active November 9, 2023 20:00
FreeTDS and pyodbc on Mac OS X 10.8 via Homebrew

After spending many hours trying to get FreeTDS and unixodbc to run on a Mac OS X 10.8 system with the python module, pyodbc, I eventually came to this recipe, which is remarkably simple thanks to homebrew. I also found unixodbc was unnecessary and I couldn't get it to play well with FreeTDS, so this install does not include unixodbc. See also http://www.acloudtree.com/how-to-install-freetds-and-unixodbc-on-osx-using-homebrew-for-use-with-ruby-php-and-perl/ and http://www.cerebralmastication.com/2013/01/installing-debugging-odbc-on-mac-os-x/.

Prerequisites: Be sure you have XCode and the Commandline Tools for XCode installed from Apple. Also install homebrew followed with brew update and brew doctor.

Install FreeTDS:

brew install freetds

Test your install:

@jronallo
jronallo / common_crawl_hostname_count.rb
Last active September 29, 2017 23:12
Ruby scripts for parsing the output from the Common Crawl URL index: https://github.com/trivio/common_crawl_index/blob/master/bin/remote_read
#!/usr/bin/env ruby
# a quick, simple script to partially parse output from https://github.com/trivio/common_crawl_index/blob/master/bin/remote_read
# and output subdomains in order of count
url_counts = {}
total_urls = 0
File.readlines(ARGV[0]).each do |line|
url = line.split(' ').first
reverse_hostname = url.split('/').first
@valguss
valguss / countries.html
Created November 17, 2010 14:06
A dropdown list of countries
<select id="country" name="country">
<option value="" selected="selected"></option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="Andorra">Andorra</option>
<option value="Antigua and Barbuda">Antigua and Barbuda</option>
<option value="Argentina">Argentina</option>
<option value="Armenia">Armenia</option>
<option value="Australia">Australia</option>