Skip to content

Instantly share code, notes, and snippets.

@Stono
Stono / 99-install-facetime-camera.sh
Created February 27, 2017 10:35
Install the kernal module required for the facetimehd camera to work on Linux
#!/bin/bash
set -e
export CONFIG_MODULE_SIG=n
export CONFIG_MODULE_SIG_ALL=n
export KERNELRELEASE=${1}
echo "Installing FacetimeHD camera for $KERNELRELEASE"
cd /tmp
git clone https://github.com/patjak/bcwc_pcie.git
@perliedman
perliedman / leaflet-reveal.css
Last active December 2, 2019 19:07
Embed Leaflet.js maps in Reveal.js presentations
.map {
width: 960px;
height: 480px;
}
.reveal .leaflet-container .leaflet-fade-anim .leaflet-tile, .reveal .leaflet-container .leaflet-fade-anim .leaflet-popup {
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
@econandrew
econandrew / fuzzymatch.R
Last active May 3, 2023 03:49
R code for fuzzy sentence matching
############################################################################ ###
# FUZZY MATCHING FUNCTIONS ####
############################################################################ ###
fuzzy_prep_words <- function(words) {
# Prepares a list of words for fuzzy matching. All the other fuzzy matching
# functions will run word through this. Given a list of sentences, returns
# a list of words.
words <- unlist(strsplit(tolower(gsub("[[:punct:]]", " ", words)), "\\W+"))
@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active February 4, 2025 00:47
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@indiesquidge
indiesquidge / homebrew.md
Last active May 27, 2025 15:08
How to and Best of Homebrew

Homebrew

How To

Homebrew is a package management system for OS X. You can read more about it here, or simply run

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

to install it.

@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active March 12, 2025 18:03
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 19, 2025 14:33
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@hrbrmstr
hrbrmstr / notify.R
Last active May 27, 2022 15:27
Send OS X notifications from R (RStudio, R GUI or R console)
notify <- function(msg="Operation complete") {
in.osx <- (Sys.info()['sysname'] == "Darwin")
in.rstudio <- (Sys.getenv("RSTUDIO") == "1")
in.rgui <- (Sys.getenv("R_GUI_APP_REVISION") != "")
if (in.rstudio) { # hack to see if running in RStudio
title <- "RStudio"
sender <- activate <- "org.rstudio.RStudio"
}
@robwierzbowski
robwierzbowski / gitcreate.sh
Last active December 27, 2024 11:23
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
@jwijffels
jwijffels / gist:5239198
Created March 25, 2013 18:00
S3 methods for streaming modelling with R package stream and for data in an ffdf
DSD_FFDFstream <- function(x, k=NA, assignment=NULL, loop=FALSE) {
stopifnot(is.ffdf(x))
open(x)
state <- new.env()
assign("counter", 1L, envir = state)
l <- list(description = "FF Data Stream",
strm = x,
state = state,
d = ncol(x),
k = k,