This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
total_runs = 100_000_000 | |
seven_socks_without_match = 0 | |
total_runs.times do |run| | |
dryer = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7].shuffle | |
picked = [] | |
iterations = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Atlanta Hawks 🐥 | |
Boston Celtics 🍀 | |
Brooklyn Nets 🏙 | |
Charlotte Hornets 🐝 | |
Chicago Bulls 🐮 | |
Cleveland Cavaliers ⚔ | |
Dallas Mavericks 🐴 | |
Denver Nuggets 🏔 | |
Detroit Pistons 🚗 | |
Golden State Warriors 💦 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'open-uri' | |
teams = { | |
atl: 'hawks', | |
bkn: 'nets', | |
bos: 'celtics', | |
cha: 'hornets', | |
chi: 'bulls', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name localhost; | |
rails_env production; | |
root /var/www/myapp/current/public; | |
passenger_enabled on; | |
index index.html index.htm; | |
client_max_body_size 50M; | |
if (-f $document_root/system/maintenance.html) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### | |
# Classes # | |
########### | |
class Group < ActiveRecord::Base | |
has_many :memberships, | |
:class_name => 'GroupUser' | |
has_many :users, | |
:through => :memberships, | |
:source => :user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user system total real | |
YAML::dump 78.990000 0.360000 79.350000 ( 79.257540) | |
to_json 2.150000 0.000000 2.150000 ( 2.143407) | |
YAML::load 11.370000 0.010000 11.380000 ( 11.368933) | |
JSON.parse 2.680000 0.050000 2.730000 ( 2.721737) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user system total real | |
YAML::dump 1.530000 0.020000 1.550000 ( 1.543227) | |
to_json 0.060000 0.000000 0.060000 ( 0.058312) | |
YAML::load 0.370000 0.000000 0.370000 ( 0.375445) | |
JSON.parse 0.070000 0.000000 0.070000 ( 0.075179) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'json' | |
require 'yaml' | |
iterations = 10_000 | |
message = {:to => 'Justin', :from => 'Andres', :subject => 'Foosball Game', :body => "Hey, sorry that I left without at least asking anyone if they wanted to play a quick game of foosball. That was really dumb. Next time I won't be dumb about that."} | |
message_yaml = YAML::dump(message) | |
message_json = message.to_json |
NewerOlder