Skip to content

Instantly share code, notes, and snippets.

Paul Stamatiou stammy

Block or report user

Report or block stammy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:8e4aa4e4911372862521
[458 pstam-blog]$ s3_website push
[info] Ignoring the extensionless_mime_type setting in /Users/stammy/code/pstam-blog/s3_website.yml. Counting on Apache Tika to infer correct mime types.
[info] Deploying /Users/stammy/code/pstam-blog/_site/* to no-www.paulstamatiou.com
[fail] Failed to upload feed/ (The website redirect location must have a prefix of 'http://' or 'https://' or '/'. (Service: Amazon S3; Status Code: 400; Error Code: InvalidRedirectLocation; Request ID: 1317F27ED7AECE65))
[fail] Failed to upload about (The website redirect location must have a prefix of 'http://' or 'https://' or '/'. (Service: Amazon S3; Status Code: 400; Error Code: InvalidRedirectLocation; Request ID: E3016510B36CBE9D))
[fail] Failed to upload feed (The website redirect location must have a prefix of 'http://' or 'https://' or '/'. (Service: Amazon S3; Status Code: 400; Error Code: InvalidRedirectLocation; Request ID: 5592047C96256EB6))
[fail] Failed to upload search (The website redirect location must have a prefix of 'htt
View gist:c6d8a632617b9fdb0e9a
onfiguration file: /Users/stammy/code/pstam-blog/_config.yml
Source: .
Destination: ./_site
Generating...
Liquid Exception: comparison of Jekyll::Document with Jekyll::Document failed in photos/index.html
/Users/stammy/code/jekyll/lib/jekyll/filters.rb:214:in `sort': comparison of Jekyll::Document with Jekyll::Document failed (ArgumentError)
from /Users/stammy/code/jekyll/lib/jekyll/filters.rb:214:in `sort'
from /Users/stammy/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/strainer.rb:43:in `invoke'
from /Users/stammy/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/context.rb:75:in `invoke'
from /Users/stammy/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/variable.rb:50:in `block in render'
View gist:47886744a65276b3f176
[458 pstam-blog]$ /Users/stammy/code/jekyll/bin/jekyll build --watch --trace
Configuration file: /Users/stammy/code/pstam-blog/_config.yml
Source: .
Destination: ./_site
Generating...
Liquid Exception: comparison of Jekyll::Document with Jekyll::Document failed in photos/index.html
/Users/stammy/code/jekyll/lib/jekyll/filters.rb:215:in `sort': comparison of Jekyll::Document with Jekyll::Document failed (ArgumentError)
from /Users/stammy/code/jekyll/lib/jekyll/filters.rb:215:in `sort'
from /Users/stammy/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/strainer.rb:43:in `invoke'
from /Users/stammy/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/liquid-2.5.5/lib/liquid/context.rb:75:in `invoke'
View convert-videos.sh
#!/bin/bash
VIDEOS=~/Dropbox/_vid
find "$VIDEOS" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 3000k -f webm -vf scale=-1:720 -bufsize 1500k -quality good -cpu-used 0 -qmin 10 -qmax 42 -c:a libvorbis -threads 8 "${0%%.mp4}.webm"' {} \;
find "$VIDEOS" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -vf scale=-1:720 -quality good -cpu-used 0 -threads 8 "${0%%.mp4}_720p.mp4"' {} \;
# square video
#find "$VIDEOS" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 3000k -f webm -aspect 1 -vf "scale=-1:720, crop=720:720" -bufsize 1500k -quality good -cpu-used 0 -qmin 10 -qmax 42 -c:a libvorbis -threads 8 "${0%%.mp4}.webm"' {} \;
#find "$VIDEOS" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -aspect 1 -vf "scale=-1:720, crop=720:720" -quality good -cpu-used 0 -threads 8 "${0%%.mp4}_720p.mp4"' {} \;
exit;
View gist:4521106
{
"color_scheme": "Packages/Color Scheme - Default/Blackboard.tmTheme",
"file_exclude_patterns":
[
"_site/*"
],
"font_face": "monaco",
"font_size": 10.5
}
@stammy
stammy / _media-queries.scss
Last active Jul 24, 2019 — forked from anthonyshort/_media-queries.scss
because you should be using ems for accessibility (zoom level) in your media queries
View _media-queries.scss
// $mq-mobile-portrait : 320px !default;
// $mq-mobile-landscape : 480px !default;
// $mq-tablet-portrait : 640px !default; -- changed because i want my blog content is around this wide, not 768. you should let content & design determine your breakpoints
// $mq-tablet-landscape : 1024px !default;
// $mq-desktop : 1382px !default;
$mq-mobile-portrait : 20em !default;
$mq-mobile-landscape : 30em !default;
$mq-tablet-portrait : 40em !default;
$mq-tablet-landscape : 64em !default;
View nginx.conf
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@stammy
stammy / gist:4166118
Created Nov 29, 2012
IAM S3 read-only
View gist:4166118
// AWS IAM S3 Read-only, single bucket policy
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetBucketAcl",
"s3:GetBucketLocation",
"s3:GetBucketNotification",
@stammy
stammy / firebase.html
Created Nov 28, 2012
Hello World Firebase
View firebase.html
<html>
<head>
<!--
+1 with firebase. now you just need to write a node app with regression logic
that listens to each new vote on each post and tracks value history to ignore and reset
any malicious db.set(0)'s people run in console when they find this completely
public script on your site. (Firebase is working on their security).
https://www.firebase.com/docs/
https://twitter.com/Stammy/status/272576842345615360
-->
@stammy
stammy / high-dpi-media.scss
Created Nov 26, 2012 — forked from kimroen/high-dpi-media.scss
A Sass media query mixin that captures almost all high DPI aware devices.
View high-dpi-media.scss
/* ----------------------------------------------------------------------- */
/* */
/* Improved upon a mixin from 37signals and combined */
/* with these numbers from marc. */
/* */
/* 37signals-version: */
/* http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss */
/* */
/* @kimroen */
/* */
You can’t perform that action at this time.