View .ruby-version
This file contains 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
3.1.1 |
View main.rb
This file contains 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
ButtonClasses = Struct.new(:classes, :variants, :defaults, keyword_init: true) do |klass| | |
def render(**settings) | |
result = [] | |
# Add the default classes if any provided | |
result << classes if classes | |
# Keep the applied variants so we can later apply the defaults | |
applied_options = [] |
View closures_in_ruby.rb
This file contains 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
# CLOSURES IN RUBY Paul Cantrell https://innig.net | |
# Email: username "paul", domain name "innig.net" | |
# I recommend executing this file, then reading it alongside its output. | |
# | |
# Alteratively, you can give yourself an unreasonable Ruby test by deleting all | |
# the comments, then trying to guess the output of the code! | |
# | |
# (Naive HR departments, please do not use that idea as a hiring quiz.) |
View Gemfile
This file contains 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
source 'https://rubygems.org' | |
gem 'light-service' | |
gem 'dry-auto_inject' | |
gem 'pry-byebug' |
View cloudSettings
This file contains 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
{"lastUpload":"2019-07-25T09:18:20.382Z","extensionVersion":"v3.4.1"} |
View cloudSettings
This file contains 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
{"lastUpload":"2019-02-06T10:52:19.643Z","extensionVersion":"v3.2.4"} |
View ping_pong.ex
This file contains 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
defmodule Match do | |
def start(max_iterations) when is_integer(max_iterations) and max_iterations > 0 do | |
spawn(__MODULE__, :init, [max_iterations]) | |
end | |
def init(max_iterations) do | |
match = self() | |
player2 = spawn(Player, :start, [:pong, match]) | |
player1 = spawn(Player, :start, [:ping, match]) |
View mysql-collation-fixer.php
This file contains 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
<?php | |
/** | |
* @package MySQL_Collation_Fixer | |
* @version 1.6 | |
*/ | |
/* | |
Plugin Name: MySQL Collation fixer | |
Description: Change database tables collation to utf8_general__ci after DB upgrade | |
Version: 1.0 | |
Author: Federico Parodi - weLaika |
View home.html.haml
This file contains 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
.page-item#ascolta= render_partial('music/home') | |
.page-item#guarda | |
%i.fa.fa-video-camera.fa-spin | |
:javascript | |
jQuery.get('/', {ajax: 'video/home'}, function(data, textStatus, xhr) { | |
jQuery('#guarda').html(data); | |
}); |
View osdetect.php
This file contains 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
<?php | |
$user_agent = getenv("HTTP_USER_AGENT"); | |
if (strpos($user_agent, "Win") !== FALSE) | |
$os = "Windows"; | |
else (strpos($user_agent, "Mac") !== FALSE) | |
$os = "Mac" | |
?> |
NewerOlder