Skip to content

Instantly share code, notes, and snippets.

@IanColdwater
IanColdwater / twittermute.txt
Last active November 26, 2023 22:30
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@StefanPetrick
StefanPetrick / Fire2018-2.ino
Last active August 13, 2023 00:54
Fire effect v2.0 for FastLED matrix
View Fire2018-2.ino
#include "FastLED.h"
// matrix size
uint8_t Width = 16;
uint8_t Height = 16;
uint8_t CentreX = (Width / 2) - 1;
uint8_t CentreY = (Height / 2) - 1;
// NUM_LEDS = Width * Height
#define NUM_LEDS 256
@odlp
odlp / bundler-rspec-inline.rb
Created August 9, 2018 09:43
Inline Bundler and autorun RSpec
View bundler-rspec-inline.rb
require "bundler/inline"
gemfile do
gem "rspec"
end
require "rspec/autorun"
RSpec.describe "inline Bundler and autorun RSpec" do
it "is convenient for self-contained examples & bug repros" do
@whitequark
whitequark / subrenamer.rb
Last active June 14, 2017 11:53
Automated subtitle file renamer
View subrenamer.rb
#!/usr/bin/env ruby
# License: BSD-0-clause
VIDEO_EXTS = %w(.mkv .avi .mp4)
SUBTITLE_EXTS = %w(.ssa .ass .srt)
if ARGV.empty?
puts "Automatic subtitle file renamer by whitequark@whitequark.org"
puts "Usage: #{$0} *.ssa *.mkv"
puts " or: DRY_RUN=1 #{$0} *.ssa *.mkv"
View iOSViewport.md

Mobile Safari's 100% Height Dilemma

Whether you're developing a web application with native-ish UI, or just a simple modal popup overlay that covers the viewport, when it comes to making things work on iDevices in Mobile Safari, you're in for a decent amount of pain and suffering. Making something "100% height" is not as easy as it seems.

This post is a collection of Mobile Safari's gotchas and quirks on that topic, some with solutions and fixes, some without, in good parts pulled from various sources across the internets, to have it all in one place. Things discussed here apply to iOS8, iOS9 and iOS10.

The Disappearing Browser Chrome

Screen real estate on smartphones is limited, so Mobile Safari collapses the browser chrome (address bar and optional tab bar at the top, and tool bar at the bottom) when the user scrolls down. When you want to make something span exactly the height of the viewport, or pin something to the bottom of the screen, this can get tricky because the viewport changes size (or

View types.markdown

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@kriegsman
kriegsman / TwinkleFOX.ino
Last active October 6, 2023 19:53
TwinkleFOX: Colored Twinkling Holiday Lights
View TwinkleFOX.ino
#include "FastLED.h"
#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define NUM_LEDS 100
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
@djvs
djvs / gist:24006c975ff11fd889e3
Last active August 12, 2021 06:31
AngularJS (Angular) HTML5 Audio Player directive from scratch
View gist:24006c975ff11fd889e3

Write your own HTML5 Audio/AngularJS audio player

example

I tried AudioJS, JPlayer, and a couple of the angular directives. Somehow they all sucked! And yet the HTML5 audio API was totally open and in theory should work fine with Angular. Time to get my hands dirty as usual....

Javascript:

app.directive('aplayer',function($interval) {

@asimihsan
asimihsan / r_tutorial.md
Last active November 10, 2019 18:00
R tutorial
View r_tutorial.md

R tutorial

Introduction

R is a software environment for statistical computing and graphics. The kinds of things people do in R are:

  • Plot charts,
  • Create and evaluate statistical models (linear, nonlinear),
  • Perform statistical analyses (tests, classification, clustering).
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active November 18, 2023 22:29
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

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: