Skip to content

Instantly share code, notes, and snippets.

View adham90's full-sized avatar
🤖
running...

Adham EL-Deeb adham90

🤖
running...
View GitHub Profile
api_key = "API_KEY" # from https://dash.bunny.net/stream/128158/security
video_id = 'VIDEO_ID'
timestamp = 1.hour.from_now.to_i
token = OpenSSL::Digest::SHA256.hexdigest("#{api_key}#{video_id}#{timestamp}")
# URL
# https://iframe.mediadelivery.net/embed/[Video_Library_ID]/[VIDEO_ID]?token=[TOKEN]&expires=[timestamp]
{
"order_id": "String",
"total_price": "String",
"seller_id": "String",
"notes": "String",
"order_items": [
{
"item_id": "String",
"unit_price": "String",
"quantity": "Number",
{
"payload":{
"first_name":"String",
"last_name":"String",
"email":"String",
"phone":"String",
"address":[
{
"city_name":"String",
"state_name":"String",
@adham90
adham90 / abbreviations.vim
Last active July 8, 2021 02:48
My vim and nvim(neovim) configurations
iabbrev myid adham90
@adham90
adham90 / rewrite-commit
Created June 25, 2017 02:30
rewrite commit message by id
git filter-branch -f --msg-filter '
if [ "$GIT_COMMIT" = "ddbe6b0d2561566aa91733c98cce086bdd50bdd5" ];
then
echo new message;
else
cat
fi' HEAD
@adham90
adham90 / 0_reuse_code.js
Created June 2, 2017 22:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@adham90
adham90 / archlinux_installation_guide.md
Last active May 18, 2024 22:15
Archlinux installation guide

#Arch Linux installation guide

  1. See what disk structure there is: $ lsblk
  2. Format boot partition: $ mkfs.ext4 /dev/sda<root> or use btrfs 😮
$ mkfs.btrfs -L "Arch" /dev/sda1
$ mount /dev/sda1 /mnt
@adham90
adham90 / authentication.rb
Created July 12, 2016 09:02 — forked from jnunemaker/authentication.rb
a starting point for authentication with mongomapper and rails
# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.
@adham90
adham90 / spacemacs-keybindings
Last active September 12, 2024 20:41
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |
NoMethodError in MessagesController#create
undefined method `fetch' for nil:NilClass
Extracted source (around line #37):
#35 # Also makes sure proper dependencies are required.
#36 def pubsub_adapter
*37 adapter = (cable.fetch('adapter') { 'redis' })
#38 path_to_adapter = "action_cable/subscription_adapter/#{adapter}"
#39 begin