Skip to content

Instantly share code, notes, and snippets.

@marknca
marknca / install-build-env.sh
Last active January 14, 2016 05:43
Python extension build environment for AWS Lambda
#! /usr/bin/env bash
# Install the required libraries for a Python build environment on Amazon Linux
# Note, you only really need lines #6 & 7, the rest of the lines install
# pre-requisities for the SciPy stack
yum -y update
yum -y groupinstall "Development Tools"
yum -y install Cython --enablerepo=epel
@anchetaWern
anchetaWern / responsive-voice.js
Created May 16, 2015 09:44
responsive-voice.js
//Look for other responsivevoice instances
/*if (window.parent != null) {
var iframes = window.parent.document.getElementsByTagName('iframe');
for (var i = 0; i < iframes.length; i++) {
//iframes[i].style.width = "300px"
}
}*/
if (typeof responsiveVoice != 'undefined') {
console.log('ResponsiveVoice already loaded');

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@jenschelkopf
jenschelkopf / hot-cloud-swap-script.md
Last active August 9, 2019 21:05
Cheat Sheet for the FoundationDB 'Hot Cloud Swap' Screencast

Cheat Sheet for the FoundationDB 'Hot Cloud Swap' Screencast

Initial Cluster Setup on Digital Ocean

Grab the client and server packages from the FoundationDB website

ansible -i inventory digital_ocean -a "wget https://foundationdb.com/downloads/f-nbxofdxnoxocd/I_accept_the_FoundationDB_Community_License_Agreement/key-value-store/2.0.9/foundationdb-clients_2.0.9-1_amd64.deb https://foundationdb.com/downloads/f-nbxofdxnoxocd/I_accept_the_FoundationDB_Community_License_Agreement/key-value-store/2.0.9/foundationdb-server_2.0.9-1_amd64.deb"

Install the client and server packages

@smhanov
smhanov / dawg.py
Last active May 11, 2025 00:53
Use a DAWG as a map
#!/usr/bin/python3
# By Steve Hanov, 2011. Released to the public domain.
# Please see http://stevehanov.ca/blog/index.php?id=115 for the accompanying article.
#
# Based on Daciuk, Jan, et al. "Incremental construction of minimal acyclic finite-state automata."
# Computational linguistics 26.1 (2000): 3-16.
#
# Updated 2014 to use DAWG as a mapping; see
# Kowaltowski, T.; CL. Lucchesi (1993), "Applications of finite automata representing large vocabularies",
# Software-Practice and Experience 1993
@staltz
staltz / introrx.md
Last active May 15, 2025 10:37
The introduction to Reactive Programming you've been missing
@carbontwelve
carbontwelve / usefull_commands.sh
Last active June 24, 2021 06:10
Running xdebug in the console, for debugging Laravel artisan commands. Useful as I keep forgetting this one...
# Running xdebug in the console, for debugging Laravel artisan commands. Useful as I keep forgetting this one...
php -dxdebug.remote_autostart artisan
#Running phpcs for 5.3:
phpcs -pv --standards= --runtime-set testVersion 5.3 --ignore=*/public/*,*.js,*.css,*/tests/*,*/views/training/* .
@Thinkscape
Thinkscape / tooltipGroup.js
Last active August 29, 2015 13:56
tooltip-group support for angular-strap
module.directive('tooltipGroup', [
var popoverRegistry = {};
var suspend = false; // semaphore used to prevent circular calling of hide triggers
function(){
return {
restrict : 'A',
priority : 1,
link : {
pre : function ($scope, el, attrs, formCtrl) {
// $scope.artifactPickerSelectOptions = artifactPicker.getSelectOptions();
@jasongaylord
jasongaylord / IEUserAgentTest.html
Last active October 10, 2023 08:04
A sample JavaScript file to detect IE compatibility mode and version. This is not recommended unless absolutely needed as features should be detected instead.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing IE Compatibility Mode</title>
<script src="ieUserAgent.js" type="text/javascript"></script>
</head>
<body>
<div id="results">Results:</div>
<script type="text/javascript">
var val = "IE" + ieUserAgent.version;
@rjsamson
rjsamson / Rakefile
Created May 27, 2013 01:50
Example Rubymotion menubar app
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/osx'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'MenubarApp'
app.info_plist['NSUIElement'] = 1
end