Skip to content

Instantly share code, notes, and snippets.

View Lauszus's full-sized avatar

Kristian Sloth Lauszus Lauszus

View GitHub Profile
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@gregburek
gregburek / rateLimitDecorator.py
Created December 7, 2011 01:51
Rate limiting function calls with Python Decorators
import time
def RateLimited(maxPerSecond):
minInterval = 1.0 / float(maxPerSecond)
def decorate(func):
lastTimeCalled = [0.0]
def rateLimitedFunction(*args,**kargs):
elapsed = time.clock() - lastTimeCalled[0]
leftToWait = minInterval - elapsed
if leftToWait>0:
@joelverhagen
joelverhagen / README.md
Created February 12, 2012 02:14
Jekyll YouTube Embed Plugin

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@kreeger
kreeger / mw2md.rb
Created March 5, 2012 22:43
Ruby: Convert MediaWiki to Markdown
#!/usr/bin/env ruby
require 'rubygems'
require 'optparse'
require 'maruku'
require 'wikicloth'
require 'tidy_ffi'
require 'pandoc-ruby'
opts = {}
OptionParser.new do |o|
@mattwilliamson
mattwilliamson / avrdude.conf
Created June 1, 2012 15:51
ATmega1284 AVRDude support
#------------------------------------------------------------
# ATmega1284
#------------------------------------------------------------
# similar to ATmega164p
part
id = "m1284";
desc = "ATMEGA1284";
has_jtag = yes;
@jpeddicord
jpeddicord / build.gradle
Last active April 14, 2023 20:31
Release APK builder that asks for your key passwords interactively, so you don't have to store them in your build script or VCS. For use with the Gradle build system. CC0 license.
// additional required configuration to hook into the build script
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}
@arusahni
arusahni / nocache.py
Last active December 28, 2022 13:12
Flask nocache decorator
from flask import make_response
from functools import wraps, update_wrapper
from datetime import datetime
def nocache(view):
@wraps(view)
def no_cache(*args, **kwargs):
response = make_response(view(*args, **kwargs))
response.headers['Last-Modified'] = datetime.now()
response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0'
@srv89
srv89 / python_email.py
Last active January 29, 2024 00:24
Python code for sending HTML email (Attachment + Multiple Recipients )
__author__ = 'srv'
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
username = '' # Email Address from the email you want to send an email
password = '' # Password
server = smtplib.SMTP('')
@maxim
maxim / gh-dl-release
Last active April 29, 2024 08:55
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@Lauszus
Lauszus / ZomBuster.sh
Last active June 3, 2018 14:09
Install OpenCV on minimal Raspbian image for use with: https://github.com/Lauszus/ImageAnalysisWithMicrocomputer30330
#!/bin/bash -e
gpio mode 8 up # Input with internal pull-up resistor
#echo "Compiling..."
#make -C ~/ImageAnalysisWithMicrocomputer30330/ZomBuster/src 1> /dev/null
echo "Press button to start"
while true; do
while [ $(gpio read 8) == 1 ]; do