The mobbing manual provides guidelines for working in a group oriented context
- Kindness
- Consideration
- Respect
- Driver Learning Goal: practice keyboarding, listening, and translation skills.
AllCops: | |
TargetRubyVersion: 2.5.1 | |
EnabledByDefault: true | |
#################### Bundler ############################## | |
Bundler/DuplicatedGem: | |
Enabled: true | |
Bundler/OrderedGems: |
// 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'); |
; 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: |
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 |
#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
#!/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} |
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:
#!/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 |
<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> |