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
str = "this is a template string with a %{placeholder} in it" | |
puts str % { "placeholder": "piece of text" } | |
# => this is a template string with a piece of text in it |
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
puts DATA.gets | |
__END__ | |
Hello Mr. World! |
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
Rails.application.routes.draw do | |
mount Citygate::Engine => "/play" | |
end |
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
Rails.application.routes.draw do | |
mount Citygate::Engine => "/play" | |
end |
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
List column_families = new ArrayList(); | |
CfDef base_columns_cf_definition = new CfDef(); | |
base_columns_cf_definition.setKeyspace("Indexes"); | |
base_columns_cf_definition.setName("PrimaryIndexes"); | |
base_columns_cf_definition.setColumn_type("Standard"); | |
base_columns_cf_definition.setComparator_type("BytesType"); | |
base_columns_cf_definition.setKey_validation_class("BytesType"); | |
base_columns_cf_definition.setDefault_validation_class("BytesType"); |
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
class UserTeamsController < ApplicationController | |
respond_to :html | |
def create | |
if is_a_coach? | |
create_a_team_for_the_coach | |
populate_flash condition: @coach_to_team_connection, | |
success_msg: t('flash.team.created.success'), | |
failure_msg: t('flash.team.created.error') |
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
url="https://exportwriter.zoho.com/remotedoc.im?apikey=#{apikey}&output=url" | |
uri = URI.parse(url) | |
req = Net::HTTP::Post.new(uri.path) | |
req.set_form_data(params) | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
response = http.request(req) |
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
#include <stdio.h> | |
void print_ages(int age) { | |
int i; | |
int number_of_trips = 0; | |
for (i = 0; i <= age; i++) | |
{ | |
if(i % 8 == 0 && i % 5 != 0) { | |
printf("%i\n", i); | |
number_of_trips++; |
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 | |
class UserMailer { | |
private $user = null; | |
public function __construct(user) | |
{ | |
$this->$user = user; | |
} | |
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
class UserMailer { | |
private $user; | |
public function __construct($user) | |
{ | |
$this->user = $user; | |
} | |
public function activation_deliver() | |
{ |