Skip to content

Instantly share code, notes, and snippets.

View danpoltawski's full-sized avatar

Dan Poltawski danpoltawski

View GitHub Profile
@Boggin
Boggin / gist:5649e5873c076060678817eab826d38b
Last active May 10, 2022 13:46
Use Restic to perform backups to Backblaze B2.
We couldn’t find that file to show.
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@jonathantneal
jonathantneal / README.md
Last active March 19, 2024 23:31
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@dmonllao
dmonllao / gist:7746252
Last active December 29, 2015 23:59
Behat cross-browser config excluding non-supported tags
// Remember to move the @_only_local tag to the non-local servers.
// Set servers IPs.
$linuxip = '127.0.0.1';
$windowsip = '192.168.xxx.xxx';
$osxip = '192.168.xxx.xxx';
$CFG->behat_config = array(
'phantomjs-linux' => array(
'filters' => array(
@jamesjennings
jamesjennings / gist:6613083
Created September 18, 2013 18:09
Script for transcoding, segmenting and preparing a video file for HLS playback. Used as a demo at 360iDev Denver 2013. Depends on HandBrakeCLI (from http://handbrake.fr/downloads2.php) and Apple's HLS tools (from https://developer.apple.com/streaming/)
HandBrakeCLI --input tears_of_steel_720p.mkv --output 5000.mp4 --encoder x264 -b 5000 --srt-file TOS-en.srt --x264-preset ultrafast
HandBrakeCLI --input tears_of_steel_720p.mkv --output 500.mp4 --encoder x264 -b 500 --srt-file TOS-en.srt --x264-preset ultrafast
HandBrakeCLI --input tears_of_steel_720p.mkv --output 50.mp4 --encoder x264 -b 50 --srt-file TOS-en.srt --x264-preset ultrafast
HandBrakeCLI --input tears_of_steel_720p.mkv --output 5.mp4 --encoder x264 -b 5 --srt-file TOS-en.srt --x264-preset ultrafast
mkdir 5000Kbps
mediafilesegmenter -t 10 -f 5000Kbps/ -I 5000.mp4
mkdir 500Kbps
mediafilesegmenter -t 10 -f 500Kbps/ -I 500.mp4
mkdir 50Kbps
@gido
gido / macosx-install-php-oracle-oci8.md
Last active June 1, 2021 08:49
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8 - homebrew environnement

Installation

This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).

PHP 5.4 installed with Homebrew.

Update: I wrote a blog post about this.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@marinaglancy
marinaglancy / testicons.php
Created May 28, 2012 07:49
Script to test icons and mimetype stings in Moodle 2.3
<?php
require_once('config.php');
require_once($CFG->libdir .'/filelib.php');
$PAGE->set_context(get_system_context());
$mimeicons = get_mimetypes_array();
?>
<style>
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/