Skip to content

Instantly share code, notes, and snippets.

@colevscode
colevscode / APIWithBasicAuth.py
Created November 8, 2011 00:43
Python class for calling methods of a REST based API. Supports basic authentication over HTTPS
# Copyright (c) 2011 Cole Krumbholz
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@colevscode
colevscode / model.js
Created May 8, 2012 01:22 — forked from syntagmatic/model.js
Basic Backbone Collection
// Model Definition
var Item = Backbone.Model.extend({
defaults: function() {
return {
text: "lorem ipsum"
}
},
});
// Collection Definition
@colevscode
colevscode / nginx.rb
Created June 30, 2012 00:18
Homebrew formula for nginx with upload
require 'formula'
class Nginx < Formula
url 'http://nginx.org/download/nginx-1.2.1.tar.gz'
head 'http://nginx.org/download/nginx-1.3.2.tar.gz'
homepage 'http://nginx.org/'
if ARGV.include? '--HEAD'
@md5='7a4f8e26b76bf9f24f884317f5614338'
else
@colevscode
colevscode / form-reset.css
Last active April 15, 2024 19:16
Formspree universal form styles
/* reset */
form input,
form select,
form textarea,
form fieldset,
form optgroup,
form label,
.StripeElement {
font-family: inherit;
font-size: 100%;
@colevscode
colevscode / formbutton-default.css
Last active September 15, 2022 18:36
Default formbutton styles.
body {
font-family: sans-serif;
font-size: 100%;
line-height: 1;
font-weight: 400;
}
#formbutton-shim {
position: fixed;
top: 0;
bottom: 0;
/* UPDATE --- It's working!
Just needed to make sure I was consistently spreading the args (or not spreading them)
and not forget that javascript typeof [] === 'object'.
*/
/*
lispparser is a lisp parser! It's meant to turn a lisp string
like this:
"(first (list 1 (+ 2 3) 9))"
import React, { Component } from "react";
import { Shaders, Node, GLSL } from "gl-react";
import {Surface, resolveAssetSource} from "gl-react-expo";
import { Image } from 'react-native';
const shaders = Shaders.create({
helloImage: {
frag: GLSL`
precision highp float;
#!/usr/bin/env python
import random
from enum import Enum
from typing import NamedTuple
from collections import Counter
from dataclasses import dataclass
class Color(Enum):
RED = 1
ORANGE = 2
@colevscode
colevscode / startup.scd
Created February 24, 2020 01:32
Supercollider Startup Script for UMC404HD with Midi

( var deviceName;

deviceName = "UMC404HD 192k"; // substitute your own device here

s.reboot { // server options are only updated on reboot

// configure the sound server: here you could add hardware specific options
// see http://doc.sccode.org/Classes/ServerOptions.html
s.options.numBuffers = 1024 * 256; // increase this if you need to load more samples