This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Requirements: VLC | |
1. Get the master.m3u8 text, use curl or Paw or just download the file and open with a text editor. | |
2. Find the url of the version you want | |
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1828000,RESOLUTION=1280x720 | |
https://cdn.videoservice.com/services/mobile/streaming/index/rendition.m3u8?assetNumber=392392 | |
3. Download that file. | |
4. Launch VLC, Choose File -> Convert/Stream from the menu | |
5. Drag the "rendition.m3u8" file onto that window, choose your settings and click save. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
/// Truncates the string to length number of characters and | |
/// doesn't truncate within a word. | |
/// appends optional trailing string if longer | |
func truncate(_ length: Int, wordSeparator: String = " ", trailing: String = "…") -> String { | |
// only truncate if needed | |
if self.characters.count > length { | |
// count the trailing characters first | |
var cumulativeCharacters = trailing.characters.count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres@e000d37cf793:/$ groups | |
postgres ssl-cert | |
postgres@e000d37cf793:/$ ls -la /etc/ssl/ | |
total 28 | |
drwxr-xr-x 7 root root 4096 Feb 10 20:40 . | |
drwxr-xr-x 95 root root 4096 Feb 10 20:44 .. | |
drwxr-xr-x 2 root root 4096 Feb 10 20:40 certs | |
-rw-r--r-- 1 root root 10835 Jan 8 20:48 openssl.cnf | |
drwxr-x--- 2 root ssl-cert 4096 Feb 10 20:40 private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ThinkingSphinx | |
class Source | |
module SQL | |
def type_values | |
['Location'] | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Depends on the command line tool: exiftool | |
# brew install exiftool | |
# it also works with mov files if they have | |
# exif data. I know my iPhone adds the exif | |
photos = Dir.glob("*.jpg",File::FNM_CASEFOLD) | |
photos.each do |file_path| | |
file_path = file_path.gsub(' ','\ ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parameters: {"auth_token"=>"2Sq2-Wo4_I0PeIu_OeRR", "options"=>{"lat"=>"33.465199999999996", "lng"=>"-111.92419833333334", "of_each"=>"15"}} | |
Geokit is using the domain: localhost | |
Location Load (9.5ms) SELECT locations.*, distance(coordinates, ST_GeomFromText('POINT(33.4657 -111.9229)')) distance FROM "locations" WHERE (nearby_categories & 1 <> 0) AND (coordinates && Expand( ST_GeomFromText('POINT(33.465199999999996 -111.92419833333334)'), 0.005)) ORDER BY distance ASC LIMIT 50 OFFSET 0 | |
Location Load (3.5ms) SELECT locations.*, distance(coordinates, ST_GeomFromText('POINT(33.4657 -111.9229)')) distance FROM "locations" WHERE (nearby_categories & 2 <> 0) AND (coordinates && Expand( ST_GeomFromText('POINT(33.465199999999996 -111.92419833333334)'), 0.005)) ORDER BY distance ASC LIMIT 50 OFFSET 0 | |
Location Load (3.4ms) SELECT locations.*, distance(coordinates, ST_GeomFromText('POINT(33.4657 -111.9229)')) distance FROM "locations" WHERE (nearby_categories & 4 <> 0) AND (coordinates && Expand( ST_GeomFromText |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Paperclip | |
class Cropper < Thumbnail | |
def transformation_command | |
if crop_command | |
cmd = crop_command + super.join(" ").sub(/ -crop \S+/, '') | |
cmd.split(" ") | |
else | |
super | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Auction | |
# is categorized once or twice | |
# with a primary_category_id and a secondary_category_id | |
# there is a Category class that acts_as_tree | |
# this scope will select duplicates if auction | |
# is categorized with a "brother" category because | |
# it has two categorizations included in the query | |
named_scope :in_category, lambda { |category_id| | |
{ :joins => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to reconnect to screen session: | |
screen -r | |
to exit screen session: | |
Ctrl+a, d | |
to kill screen session: | |
Ctrl+a, k |
NewerOlder