Skip to content

Instantly share code, notes, and snippets.

View neps-in's full-sized avatar
🏠
Working from home

Napoleon Arouldas neps-in

🏠
Working from home
View GitHub Profile
@GAS85
GAS85 / http2_apache2_ubuntu16.04.md
Last active February 7, 2023 16:17
How to Enable HTTP/2 in Apache 2.4 on Ubuntu 16.04

Requirements

  • A self-managed VPS or dedicated server with Ubuntu 16.04 running Apache 2.4.xx.
  • For Ubuntu 18.04 please read here --> https://gist.github.com/GAS85/8dadbcb3c9a7ecbcb6705530c1252831
  • A registered domain name with working HTTPS (TLS/SSL). HTTP/2 only works alongside HTTPS because most browsers, including Firefox and Chrome, don’t support HTTP/2 in cleartext (non-TLS) mode.
@meandmax
meandmax / getcookiebyname.js
Last active October 27, 2020 02:01
get the cookie value by name if a cookie name exists.
/**
* get cookie by name without using a regular expression
*/
var getCookie = function(name) {
var getCookieValues = function(cookie) {
var cookieArray = cookie.split('=');
return cookieArray[1].trim();
};
var getCookieNames = function(cookie) {
@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active October 9, 2023 12:15
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

@janikvonrotz
janikvonrotz / Apache Rewrite Rules.txt
Created June 10, 2013 14:52
Apache: Rewrite Rules #Apache
#Rewerite canonical URL
RewriteEngine On
RewriteCond %{HTTP_HOST} ^snippetdb.com$
RewriteRule (.*) http://www.snippetdb.com$1 [R=301]
#.htaccess rewrite examples should begin with: ^
Options +FollowSymLinks
RewriteEngine On
@bramus
bramus / .htaccess
Last active November 10, 2023 20:20
URL Rewriting for Apache (requires mod_rewrite) and IIS (requires IIS url rewrite module)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
@kig
kig / my_bucket_put
Created February 4, 2013 17:26
A script to upload files to an S3 bucket. Sets mime type headers for HTML, CSS, JS, JPEG, GIF and PNG. Sets a thirty-year Expires header for images. Gzips HTML, CSS and JS.
#!/usr/bin/ruby
# USAGE: my_bucket_put FILE_1 [FILE_N...]
# Uploads $local_path_for_bucket/FILE_1 to my_bucket/FILE_1
# This script has very little configuration to keep it simple (and serve my limited needs).
# Create a pre-configured copy of this for all your buckets. Or add command line flags.
#
# Change this to your bucket name
bucketname = "my_bucket"
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: