Skip to content

Instantly share code, notes, and snippets.

/**
░█▀█░█▀▀░█▀█░█▀▄░░░█▀▀░█░█░▀█▀░█░█░█▀▄░█▀▀░░░█░░░█▀█░█▀▄░█▀█░█▀▄░█▀█░▀█▀░█▀█░█▀▄░█░█
░█░█░█▀▀░█▀█░█▀▄░░░█▀▀░█░█░░█░░█░█░█▀▄░█▀▀░░░█░░░█▀█░█▀▄░█░█░█▀▄░█▀█░░█░░█░█░█▀▄░░█░
░▀░▀░▀▀▀░▀░▀░▀░▀░░░▀░░░▀▀▀░░▀░░▀▀▀░▀░▀░▀▀▀░░░▀▀▀░▀░▀░▀▀░░▀▀▀░▀░▀░▀░▀░░▀░░▀▀▀░▀░▀░░▀░
*/
// Sources flattened with hardhat v2.6.8 https://hardhat.org
// File @openzeppelin/contracts/utils/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bleeckerj
bleeckerj / Square And White Frame
Created November 22, 2018 17:04
Use ffmpeg to pad and square and white-frame a video
ffmpeg -i out.mp4 -vf "pad=width=1350:height=1350:x=0:y=225:color=white" out-square.mp4
@bleeckerj
bleeckerj / MakeVideoFromImages
Last active November 22, 2018 03:00
Add Date to Images, then concatenate into a video, then make the video square with white padding frame
#!/bin/zsh
for i in *.jpg; do
x=$(exiftool -T -createdate $i)
y="$(sed 's/:/ /g' <<< $x)"
#ffmpeg -i $i -vf "drawtext=fontfile=/Users/julian/Dropbox (OMATA)/Brand-PR-Marketing/Yearbook 2016/Drafts/OMATA_ yearbook_BI_v09_cover_perfect Folder (1)/Document fonts/NB Architekt Neue.otf:text=$x" mod-$i.jpg
ffmpeg -i $i -vf "drawtext=fontfile=/Users/julian/Dropbox (OMATA)/Brand-PR-Marketing/Yearbook 2016/Drafts/OMATA_ yearbook_BI_v09_cover_perfect Folder (1)/Document fonts/NB Architekt Neue.otf:text=$y:fontsize=90:x=20:y=800" mod-$i
done
ffmpeg -framerate 11 -pattern_type glob -i 'mod*' -c:v libx264 -pix_fmt yuv429p out.mp4
@bleeckerj
bleeckerj / gist:a2246e87e04ce3923799aff3e895e756
Created September 5, 2018 14:51
Collection Page Sorting Code for Shopify
<div class="filter">
{% if section.settings.coll_show_tags %}
{% if collection.url.size == 0 %}
{% assign collection_url = '/collections/all' %}
{% else %}
{% assign collection_url = collection.url %}
{% endif %}
{% assign show_tag_filter = false %}
{% capture tag_filter_html %}
@bleeckerj
bleeckerj / ConvertGarminEpoch.js
Created September 4, 2018 03:39
You need to add 631065600 to Garmin Timestamps to bring them into the standard Epoch.
function ConvertGarminEpoch() {
var inputtext = document.getElementById("ginput").value;
inputtext = inputtext.replace(/\s+/g, '');
if (inputtext.charAt(inputtext.length - 1) == "L") {
inputtext = inputtext.slice(0, -1);
}
var outputtext = "<br>";
inputtext = ( ( inputtext * 1 ) + 631065600 ) * 1000;
@bleeckerj
bleeckerj / ProductReviewsBadge Snippit
Created August 26, 2018 16:58
Put this in product.liquid somewhere, for example, under {{product.title}} to make the product reviews badge appear there.
<span class="shopify-product-reviews-badge" data-id="{{ product.id }}"></span>
<h1 itemprop="name">{{ product.title }}</h1>
@bleeckerj
bleeckerj / Shell.swift
Created July 16, 2018 21:59 — forked from andreacipriani/Bash.swift
Execute bash commands from Swift 3
import Foundation
final class Shell
{
func outputOf(commandName: String, arguments: [String] = []) -> String? {
return bash(commandName: commandName, arguments:arguments)
}
// MARK: private
@bleeckerj
bleeckerj / Fonts.swift
Created May 19, 2018 19:47 — forked from khanlou/Fonts.swift
Print all fonts in Swift 3
UIFont.familyNames.forEach({ familyName in
let fontNames = UIFont.fontNames(forFamilyName: familyName)
print(familyName, fontNames)
})
@bleeckerj
bleeckerj / splitBy.swift
Last active March 3, 2018 14:17 — forked from ericdke/splitBy.swift
Swift: split array by chunks of given size
let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
extension Array {
func chunks(_ chunkSize: Int) -> [[Element]] {
return stride(from: 0, to: self.count, by: chunkSize).map {
Array(self[$0..<Swift.min($0 + chunkSize, self.count)])
}
}
}