Skip to content

Instantly share code, notes, and snippets.

View pbroschwitz's full-sized avatar

Peter Broschwitz pbroschwitz

View GitHub Profile
@pbroschwitz
pbroschwitz / list-image-dimensions
Created January 24, 2013 09:23
List image dimensions in directory
$>identify -format "%wx%h - %f\n" *.jpg
@pbroschwitz
pbroschwitz / dabblet.css
Created June 4, 2013 10:36 — forked from anselmh/dabblet.css
Untitled
.overflowed > p{
width: 10em;
height: 5rem;
white-space: pre-line;
overflow: hidden;
outline: 1px dashed lime;
}
.overflowed-clip {
text-overflow: clip;
@pbroschwitz
pbroschwitz / 1. elements.html
Created July 3, 2013 17:09 — forked from Integralist/1. elements.html
Checkbox Hack (works in modern browsers and IE9+)
<label for="toggle-1">I'm a toggle</label>
<input type="checkbox" id="toggle-1">
<div>I'm controlled by toggle. No JavaScript!</div>
/**
* This is similar to http://php.net/manual/en/function.array-reduce.php but returns
* the return from the callback immediately when it is 'truthy'. The callback also
* is being passed the 'key' in addition to just the 'value'. So this is basically
* some sort of more flexible array_reduce, array_filter and array_search
*/
function array_find($array, $callback) {
foreach ($array as $key => $value) {
$result = $callback($value, $key);
if ($result) {
function aContainsB (a, b) {
return a.indexOf(b) >= 0;
}
var philosophers = "Aquinas, Maimonedes, and Avicenna";
var me = "Joshua";
function printPhilosopherStatus (person) {
if (aContainsB(philosophers, person)) {
console.log(person + " is a philosopher.");
@pbroschwitz
pbroschwitz / dabblet.css
Created June 20, 2014 14:52 — forked from LeaVerou/dabblet.css
Test for rebeccapurple, honoring Eric Meyer’s Daughter, Rebecca.
/**
* Test for rebeccapurple, honoring Eric Meyer’s Daughter, Rebecca.
* Currently works in WebKit nightlies, other implementations soon to follow.
*/
background: red;
background: rebeccapurple;
display: flex;

Local SSL websites on Mac OSX

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on Mac OSX Yosemite.


Configuring Apache

@pbroschwitz
pbroschwitz / 0_reuse_code.js
Created October 27, 2015 13:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pbroschwitz
pbroschwitz / index.html
Last active February 10, 2016 09:33
Classical Reuse Patterns / JavaScript
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Classical Pattern - Code Reuse Pattern</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">