Skip to content

Instantly share code, notes, and snippets.

View skynet's full-sized avatar

Ionel Roiban skynet

View GitHub Profile
@skynet
skynet / encode.sh
Created July 24, 2019 19:21 — forked from mikoim/README.md
YouTube recommended encoding settings on ffmpeg (+ libx264)
#/bin/sh
ffmpeg -i input -c:v libx264 -preset slow -profile:v high -crf 18 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low output
@skynet
skynet / upgrade-php7.sh
Created December 29, 2018 03:52 — forked from heathdutton/upgrade-php7.sh
Upgrade PHP to 7.3 on Amazon Linux (specifically for Elastic Beanstalk but should work elsewhere)
#!/usr/bin/env bash
# Upgrade an Amazon Linux EC2 to PHP 7.3
#
# Last tested w/ PHP 7.2 AWS Linux version 2.8.5
#
# Must be ran as sudo:
# sudo bash upgrade-php7.sh
#
# Can be added to ./.ebextensions/20_php.config like so:
# container_commands:
@skynet
skynet / aws-linux-2-wordpress.sh
Created December 9, 2018 01:02 — forked from byronfriesen/aws-linux-2-wordpress.sh
Amazon Linux 2 LTS - Wordpress / PHP-FPM / NGINX / MariaDB / WP-CLI Auto Install
#!/bin/bash
##############################################################
# Set Your System and Wordpress Config Preferences
##############################################################
export SYSTEM_USER=username # User PHP-FPM runs under
# Database
export WP_DB_NAME=wordpress
@skynet
skynet / etc-hosts-on-win.md
Created August 15, 2018 15:50 — forked from zenorocha/etc-hosts-on-win.md
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad

const Twit = require('twit')
exports.main = (args) => {
let twitter_consumer_key = args.twitter_consumer_key
let twitter_consumer_secret = args.twitter_consumer_secret
let twitter_access_token = args.twitter_access_token
let twitter_access_token_secret = args.twitter_access_token_secret
// If the required tokens aren't received end all operations
if (!twitter_consumer_key || !twitter_consumer_secret ||
@skynet
skynet / galleria-video-pause.js
Created August 25, 2017 23:08 — forked from tomjnsn/galleria-video-pause.js
Wire up Galleria to detect YouTube and Vimeo videos playing so it pauses the slideshow while videos are playing.
var autoplayLength = 8000;
var gallery = false;
var ytplayer = false;
$(function() {
if (window.addEventListener) {
window.addEventListener('message', messageReceived, false);
} else {
window.attachEvent('onmessage', messageReceived, false);
}
@skynet
skynet / galleria-video-pause.js
Created August 25, 2017 23:08 — forked from tomjnsn/galleria-video-pause.js
Wire up Galleria to detect YouTube and Vimeo videos playing so it pauses the slideshow while videos are playing.
var autoplayLength = 8000;
var gallery = false;
var ytplayer = false;
$(function() {
if (window.addEventListener) {
window.addEventListener('message', messageReceived, false);
} else {
window.attachEvent('onmessage', messageReceived, false);
}
@skynet
skynet / touch-icons.html
Created November 2, 2015 05:14 — forked from kevinSuttle/touch-icons.html
Touch icon link syntax
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png">
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: -->
@skynet
skynet / AWSLambdaSimpleSMS.js
Last active September 2, 2015 19:43 — forked from stevebowman/AWSLambdaSimpleSMS.js
AWS Lambda Function to send an SMS message via the Twilio API
console.log('Loading event');
// Twilio Credentials
var accountSid = '';
var authToken = '';
var fromNumber = '';
var https = require('https');
var queryString = require('querystring');
@skynet
skynet / nginx.conf
Last active August 29, 2015 05:35 — forked from meineerde/nginx.conf
Check the Accept-Language Header to emulate part of Apache's content negotiation features. This is based on http://stackoverflow.com/questions/3657614/how-to-rewrite-location-in-nginx-depending-on-the-client-browsers-language
map $http_accept_language $lang {
default en;
~de de;
~en en;
}
location /foo/bar/baz/lang.js {
try_files $uri.$lang $uri;
}