Skip to content

Instantly share code, notes, and snippets.

@joel-extremo
joel-extremo / NewHomeworkNotification.php
Created January 16, 2019 14:54
NewHomeworkNotification
<?php
namespace App\Repository\PushNotification;
class NewHomeworkNotification extends OkusPushNotification
{
protected $notificationTitle = 'Nueva Tarea';
protected $notificationType = 'new_homework';
{
"message": "Class 'MongoDB\\Driver\\Manager' not found",
"exception": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
"file": "/var/app/current/vendor/mongodb/mongodb/src/Client.php",
"line": 87,
"trace": [
{
"file": "/var/app/current/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Connection.php",
"line": 141,
"function": "__construct",
<%= link_to href: 'http://www.example.com/' do %>
<%= image_tag 'happyface.png', width: 136, height: 67, alt: 'a face that is unnervingly happy'%>
<% end %>
def alphabetize(arr, rev=false)
if rev
arr.sort! { |item1, item2| item2 <=> item1 }
else
arr.sort! { |item1, item2| item1 <=> item2 }
end
end
books = ["Heart of Darkness", "Code Complete", "The Lorax", "The Prophet", "Absalom, Absalom!"]
@joel-extremo
joel-extremo / error.txt
Created September 30, 2018 11:58
error
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.5.1
###### WARNING:
Removing `Gemfile.lock` because it was generated on Windows.
Bundler will do a full resolve so native gems are handled properly.
This may result in unexpected gem versions being used in your app.
In rare occasions Bundler may not be able to resolve your dependencies at all.
https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 1.15.2
<?php
public function FunctionName()
{
$url = $this->GLOBAL_cdn_streaming_domain;
array_map(function($movie) use ($url){
$movie->video_url = $url . $movie->video_url;
$movie->image = $url . $movie->image;
$movie->big_image = $url . $movie->big_image;
class Pet
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
@joel-extremo
joel-extremo / cat.rb
Created September 15, 2018 16:19
3.4: Object-Oriented Programming I
class Cat
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
@joel-extremo
joel-extremo / fav_foods..rb
Created September 15, 2018 12:31
3.3: Data Structures
def fav_foods
food_array = []
3.times do
puts "Name a favorite food."
food_array << gets.chomp
end
puts "Your favorite foods are #{food_array.join(", ")}."
if (5+5 == 10)
puts "this is true"
else
puts "this is false"
end