Skip to content

Instantly share code, notes, and snippets.

View Tgemayel's full-sized avatar
🏀
#GetBuckets

Toni Gemayel Tgemayel

🏀
#GetBuckets
View GitHub Profile
@Tgemayel
Tgemayel / colors.json
Last active September 27, 2020 05:52
NBA colors
{
"team":"miami heat",
"id": "1"
"colors": ["red, yellow, black"]
{
"colorName":"miami heat red",
"HEX":"98002E",
"RGB":"(152,0,46)",
"CMYK":"(0,100,61,43)"
}
.col-lg-4.col-md-4
.one-post-card.card.datacont
= link_to article
.header.clearfix
.title.proxima-semibold = article.data.title
.icon
= image_tag article.data.image
.body
p = article.data.description.truncate(160)
= image_tag article.data.image
@Tgemayel
Tgemayel / stripe-decline-codes.rb
Created June 26, 2019 19:46
Stripe decline codes
# frozen_string_literal: true
require 'stripe'
module Stripe
# A subscription schedule allows you to create and manage the
# lifecycle of a subscription by predefining expected changes.
DECLINE_CODES = HashWithIndifferentAccess.new(
approve_with_id: "The payment cannot be authorized. The payment should be attempted again. If it still cannot be processed, contact the card issuer.",
call_issuer: "The card has been declined for an unknown reason. Try a different payment method, or contact the card issuer for more information.",
card_not_supported: "The card does not support this type of purchase. Contact the card issuer to make sure the card can be used to make this type of purchase.",
param :first_name, String, required: true, format: /^[a-zA-Z -]{2,30}$/
param :last_name, String, required: true, format: /^[a-zA-Z -]{2,30}$/
param :email, String, required: true, transform: :downcase, format: /^[a-z0-9.+]{1,45}@[a-z0-9-]+(\.[a-z0-9]{2,})+$/
param :company_name, String, required: true
param :title, String, required: true, min_length: 3
param :message, String, required: true, min_length: 10
@Tgemayel
Tgemayel / cors.rb
Created April 2, 2019 07:16
Cors Headers example
before do
headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, DELETE, OPTIONS'
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Headers'] = 'accept, authorization, origin'
end
@Tgemayel
Tgemayel / gradients.html
Created March 11, 2019 18:19
CSS Gradient Scroll
<div class="bg">
</div>
.bg {
/* Background image and gradient */
background: url() fixed, linear-gradient(to bottom, #ffee75 3%,#ffb06b 27%,#e86f97 50%,#b08cff 75%,#5477af 100%);
/* Background blend mode
for blending the image and thegradient.
@Tgemayel
Tgemayel / incognito.js
Created November 13, 2018 21:30
Checks if you are incognito mode
function main() {
var fs = window.RequestFileSystem || window.webkitRequestFileSystem;
if (!fs) {
result.textContent = "check failed?";
return;
}
fs(window.TEMPORARY, 100, function(fs) {
result.textContent = "it does not seem like you are in incognito mode";
}, function(err) {
result.textContent = "it seems like you are in incognito mode";
@Tgemayel
Tgemayel / ios-blue-links.html
Created October 30, 2018 18:41
iOS blue links email css fix
### Keybase proof
I hereby claim:
* I am tgemayel on github.
* I am udonis (https://keybase.io/udonis) on keybase.
* I have a public key ASDiUTlRmr2gVXKijYTp1VcWmn_K9tUu15wbNrYM7E1s9Ao
To claim this, I am signing this object:
@Tgemayel
Tgemayel / Rfid.py
Last active February 14, 2018 00:30
A script to read RFID cards using parralax RFID serial card reader
#! /usr/bin/env python3
import RPi.GPIO as GPIO
import serial
import sys
ENABLE_PIN = 18 # The BCM pin number corresponding to GPIO1
SERIAL_PORT = '/dev/ttyAMA0' # The location of our serial port. This may
# vary depending on OS version.