Go to the egghead website, i.e. Building a React.js App
run
$.each($('h4 a'), function(index, video){
console.log(video.href);
});
<<APP>> change this variables |
<<USER>> <<APP>> change this variables |
Go to the egghead website, i.e. Building a React.js App
run
$.each($('h4 a'), function(index, video){
console.log(video.href);
});
""" | |
Simple algorithm to download all the egghead.io videos in highest-quality from YouTube. | |
Run from the directory you want the videos to appear. Renames them so that they have the video number + omit the repetitive "Egghead.io - AngularJS -" text. | |
Installing dependency: | |
$ pip install git+https://github.com/NFicano/pytube#egg=pytube | |
""" | |
from pytube import YouTube #, exceptions as YTD_exceptions |
# Small Python Script to scrape websites for | |
# email addresses and phone numbers(not a very great RE) | |
# Author: Dhruv Baldawa (@dhruvbaldawa on twitter) | |
# Github: http://www.github.com/dhruvbaldawa | |
import urllib,re | |
f = urllib.urlopen("http://www.example.com") | |
s = f.read() | |
re.findall(r"\+\d{2}\s?0?\d{10}",s) | |
re.findall(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}",s) |
# in controller | |
# for local files | |
send_file '/path/to/file', :type => 'image/jpeg', :disposition => 'attachment' | |
# for remote files | |
require 'open-uri' | |
url = 'http://someserver.com/path/../filename.jpg' | |
data = open(url).read | |
send_data data, :disposition => 'attachment', :filename=>"photo.jpg" |
class BaseUploader < CarrierWave::Uploader::Base | |
attr_reader :width, :height | |
before :cache, :capture_size | |
... | |
# for image size validation | |
# fetching dimensions in uploader, validating it in model | |
def capture_size(file) | |
if version_name.blank? # Only do this once, to the original version |
Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.
The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows
the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir
and you are good to go.
Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to
a specific version, you will need to compile it yourself. Then asdf
is your best friend.
Run this | |
"sudo -u postgres psql" | |
in your terminal to get into postgres | |
postgres=# | |
Run "CREATE USER new_username;" | |
Note: Replace new_username with the user you want to create, |