Skip to content

Instantly share code, notes, and snippets.

View Keqi's full-sized avatar

Maciej Nowak Keqi

View GitHub Profile
irb(main):002:0> summary = "<p>Some summary review.</p>\n\r"
=> "<p>Some summary review.</p>\n\r"
irb(main):003:0> detail = "<p>Some detailed review</p>\n"
=> "<p>Some detailed review</p>\n"
irb(main):004:0> CrazyHarry.fragment(summary).redact!(unsafe: true, tags: 'p').to_s
=> "Some summary review."
irb(main):005:0> CrazyHarry.fragment(summary + detail).redact!(unsafe: true, tags: 'p').to_s
=> "Some summary review.\n\n\rSome detailed review"
departures = [
{
availability: 12,
start_date: "2013-05-11",
pricing: [
{
age_group: "Child",
prices: [
{:name=>"USD", :value=>1199.0},
{:name=>"AUD", :value=>1199.0},
departures = [
{
availability: 12,
start_date: "2013-05-11",
pricing: [
{
age_group: "Child",
prices: [
{:name=>"USD", :value=>1199.0},
{:name=>"AUD", :value=>1199.0},
departures: [
{
availability: 2
discounted: false
discount: nil
start_date: 06-04-2013
pricing: [
Some prices
]
},
departures: [
{
availability: 2
discounted: false
start_date: 06-04-2013
pricing: [
{
age_group: "Adult",
prices: [
{name: "USD", value: 1000},
public class Koło {
private double promień;
public Koło(int a){
promień = a;
}
public double obliczObwódKoła(){
return 2*Math.PI*promień;
}
public class Koło {
int promień;
public Koło(int a){
promień = a;
}
}
@Keqi
Keqi / problem.rb
Last active January 9, 2020 15:55
class ProjectsController < ApplicationController
# student.project is the reference to associated AR Project model.
def users_projects
teams = Team.all
students = teams.map(&:students).flatten
@student_projects = students.select do |student|
student.project.status == "Active"
end
end
<div class="row mt-3">
<div class="col-10">
<table class="table dashboard-daily-table">
<thead class="thead-light dashboard-daily-table-header">
<tr>
<th width="18%" scope="col"><%= Date.today.strftime("%A") %></th>
<th width="64%" scope="col"></th>
<th width="18%" scope="col"></th>
</tr>
</thead>
class User
def admin?
role == 'admin'
end
def marketer?
role == 'marketer'
end
def sales?