Skip to content

Instantly share code, notes, and snippets.

View thegreyfellow's full-sized avatar
🏠
Working Remotely

Youssef Idmoussi thegreyfellow

🏠
Working Remotely
  • Rabat, Morocco.
  • 18:24 (UTC -12:00)
View GitHub Profile
@thegreyfellow
thegreyfellow / youtube-dl.md
Created February 19, 2021 09:32 — forked from edgardo001/youtube-dl.md
Using youtube-dl to download courses from Pluralsight

Download courses from learning sites with youtube-dl

You can download whole courses from an array of tutorial sites with the CLI tool youtube-dl. In the example further down I'm using my Pluralsight account to get videos from a course at their site. Here is a list of all supported sites that you can download from with this tool

The flags you have to supply may vary depending on which site you make a request to.

You can get a free 3 month trial to Pluralsight by signing up for free to Visual Studio Dev Essentials

Installation

@thegreyfellow
thegreyfellow / bm-string-contains-any-in-array.rb
Created July 23, 2018 14:31 — forked from alecguintu/bm-string-contains-any-in-array.rb
Check if string contains any substring in an array in Ruby
require 'benchmark'
iterations = 1_000_000
words = 'foo, bar, test, boo'.split(',').map(&:strip)
string = 'this is going foo be awesome~!'
Benchmark.bmbm do |bm|
bm.report do
iterations.times do
words.any? { |s| string.include?(s) }
end
@thegreyfellow
thegreyfellow / pre-commit
Last active July 22, 2018 18:18 — forked from tinogomes/pre-commit-complete
Git Hook pre-commit to pass Rubocop and Brakeman on Rails application for validations
#!/bin/sh
#
# Check for ruby style errors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
NC='\033[0m'
if git rev-parse --verify HEAD >/dev/null 2>&1
@thegreyfellow
thegreyfellow / ruby_on_rails5.md
Created January 4, 2018 15:05 — forked from taisyo7333/ruby_on_rails5.md
ruby on rails5 はまったこと

現象

# bundle exec rails c
Could not find rake-12.3.0 in any of the sources
Run `bundle install` to install missing gems.

解決

# bundle install --binstubs
@thegreyfellow
thegreyfellow / 0_reuse_code.js
Created June 6, 2017 12:01
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
#!/usr/bin/env ruby -wKU
puts '****************************************'
availability = (8..12)
puts "looking for availability in this interval:\n #{availability}"
puts '****************************************'
rb1 = (6..9)
puts rb1
rb2 = (10..11)
puts rb2