Skip to content

Instantly share code, notes, and snippets.

Avatar
👑
ruling the world

Jatto Abdulqahhar jattoabdul

👑
ruling the world
View GitHub Profile
View gist:1193ffe927073470832bdba1a81ba6f4
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@jattoabdul
jattoabdul / africanTechPros.json
Last active May 19, 2020
A list of Popular African Tech Leaders
View africanTechPros.json
[
{
"name": "Abdulsamii Ajala",
"proPic": "/images/vuevocate.jpg",
"currentLocation": {
"city": "Ilorin",
"country": "Nigeria",
"countryCode": "NG"
},
"nationality": {
@jattoabdul
jattoabdul / subscriptions.html.erb
Created Nov 1, 2019
Write the code for app/views/admins/subscriptions.html.erb to display in a particular format while using bootstrap css framework in rails views
View subscriptions.html.erb
<div class="container-fluid">
<% @subscriptions.each do |subscription| %>
<div class="row">
<div class="col-md-8 col-sm-12 col-xs-12">
<%= mail_to "subscription.email" %>
</div>
<div class="col-md-4 col-sm-12 col-xs-12">
<span><%= subscription.plan&.name %></span>
</div>
</div>
@jattoabdul
jattoabdul / noteable.rb
Last active May 13, 2019
Using Active Support Concerns
View noteable.rb
require 'activesupport/concern'
module Noteable
extend ActiveSupport::Concern
included do
has_many :notes, as: :noteable
end
def note_taking_action
@jattoabdul
jattoabdul / Ruby Rubocop Style guide
Created Oct 7, 2018
This should be in the .rubocop.yml file in the root of your rails app after installing and configuring rubocop
View Ruby Rubocop Style guide
AllCops:
Exclude:
- "vendor/**/*"
- "db/**/*"
- "tmp/**/*"
- "bin/**/*"
- "log/**/*"
- "config/**/*"
- "app/assets/**/*"
- "Rakefile"
View Javascript Style Guide.md
{
  "root": true,
  "extends": "airbnb-base",
  "env": {
    "node": true,
    "es6": true,
    "mocha": true
  },
  "rules": {
View remove__num_suffix_in_action.py
def __num_suffix(self, check_in_date):
"""
Strip the date suffix and return the date
Before comparing the date
"""
date_value = str(check_in_date).split(' ')
day_value = date_value[0][:-2]
date_value[0] = day_value
return ' '.join(date_value)
View __convert_to_date_in_actions.py
def __convert_to_date(self, date_string):
today = date.today()
if date_string == 'today':
return today
elif date_string == 'yesterday':
return today - timedelta(days=1)
elif date_string == 'tomorrow':
return today + timedelta(days=1)
else:
return today
View my_tasks_in_actions.py
def my_tasks(self):
email = self.user_info['user']['profile']['email']
recipient = self.user_info['user']['id']
task_cells = list(filter(lambda x: x['Email Address'] == email, self.sheet))
for index, row in enumerate(task_cells):
text_detail = (
'*Task #{} for {}:* \n\n'
'*Hey {},* Today is the check-in day for your writeup titled\n'
'`{}`.\n\n'
'Whats the status of the article?\n'
View help_method_in_actions.py
def help(self):
"""
Return the Available commands in the system and their usage format
"""
return {
'text': 'Available Commands: \n `/ranti my-task e.g. /ranti my-task` \n To get task assigned to you.\n'
' \n `/ranti show-task [date]{dth-month-year} e.g. /ranti show-task 5th-june-2018` \n Show all tasks for a particular date \n'
'\n `/ranti show-task [today] e.g. /ranti show-task today` \n Show all tasks for today \n'
'\n `/ranti show-task [tomorrow] e.g. /ranti show-task tomorrow` \n Show all tasks for tomorrow \n'
'\n `/ranti help` \n This help information \n \n Ranti Ver: 1.0'}