Skip to content

Instantly share code, notes, and snippets.

View mypetyak's full-sized avatar

Christopher Bunn mypetyak

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mypetyak on github.
  • I am bunn (https://keybase.io/bunn) on keybase.
  • I have a public key whose fingerprint is A92A 7137 0D27 662E 291B 737C 803F F963 DF3E 39C6

To claim this, I am signing this object:

@mypetyak
mypetyak / unicode_sandwich.py
Created November 1, 2015 21:19
Unicode Sandwich, demonstrating multiple encodings.
# -*- encoding: utf-8 -*-
import re
# Byte string containing an Icelandic pangram encoded in mac_iceland
input = 'Svo h\x9alt, yxna k\xe0r \xdfeg\xddi j\x9c um d\x97p \x92 f\x8e \x87 b\xbe.'
# Create a Unicode object from the string, decoding with the mac_iceland
# encoding
u_string = input.decode('mac_iceland')
re.sub(r'\w{4}', u'xxxx', u_string, flags=re.UNICODE)
@mypetyak
mypetyak / build_arm7_kernel.sh
Created November 27, 2016 01:04
build a new kernel for ARM7 CHIP
#!/bin/bash
# The first argument should be the path to the existing
# kernel .config file you'd like to use as a baseline.
# Inspired by http://www.raspibo.org/wiki/index.php/Compile_the_Linux_kernel_for_Chip:_my_personal_HOWTO
# practice safe bash
set -e
set -u
set -o pipefail
@mypetyak
mypetyak / config-4.4.13bunn007+
Created November 27, 2016 01:30
kernel config for CHIP
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.4.13 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_ARM_DMA_USE_IOMMU=y
CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8
CONFIG_MIGHT_HAVE_PCI=y
@mypetyak
mypetyak / OSX-Convert-MOV-GIF.md
Last active March 29, 2020 04:28 — forked from tskaggs/OSX-Convert-MOV-GIF.md
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert .mov to .gif

# produce frames
❯ ffmpeg -i ernie.mov -vf scale=200:-1 -r 5 output/ffout%3d.png

# compose the .gif
❯ convert -delay 8 -loop 0 output/ffout*.* output/animation.gif

# shrink the file
❯ mogrify -layers 'optimize' -fuzz 7% output/animation.gif