Skip to content

Instantly share code, notes, and snippets.

View dennisreimann's full-sized avatar
still hungry. still foolish.

d11n dennisreimann

still hungry. still foolish.
View GitHub Profile
@addyosmani
addyosmani / README.md
Last active April 29, 2025 13:39 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@evancz
evancz / Haskell-Style-Guide.md
Last active March 23, 2023 15:27
A style guide for Elm tools

Haskell Style Guide for Elm

Goal: a consistent style throughout all Elm projects that is easy to read and produces clean diffs to make debugging easier. This means valuing regularity and simplicity over cleverness.

Line Length

Keep it under 80 characters. Going over is not the end of the world, but consider refactoring before you decide a line really must be longer.

Variables

@MattWilcox
MattWilcox / build_nginx.sh
Last active March 6, 2022 18:01
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2d
export VERSION_NGINX=nginx-1.9.7
# URLs to the source directories
export SOURCE_OPENSSL=https://www.openssl.org/source/
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
## app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
@@silenced_actions = [:home]
def home
end
end
@adam-lynch
adam-lynch / requireNoCache.js
Last active April 12, 2025 08:46
Require a module, without going to Node.js's require cache
var path = require('path');
var _invalidateRequireCacheForFile = function(filePath){
delete require.cache[path.resolve(filePath)];
};
var requireNoCache = function(filePath){
_invalidateRequireCacheForFile(filePath);
return require(filePath);
};
@simonwhitaker
simonwhitaker / one-simple-block-trick.markdown
Last active August 29, 2015 13:57
Wrapping a method implementation

Here's a nice trick for wrapping a method's implementation in a block, for example for logging the return value.

Have you ever written a method with a load of conditionals and return statements...

- (int)statusCode {
    if (foo) {
        return 1;
    }
    if (bar) {
<?xml version="1.0"?>
<config>
<modules>
<Davidf_AddCustomerGroupColumns>
<active>true</active>
<codePool>local</codePool>
</Davidf_AddCustomerGroupColumns>
</modules>
</config>
@alexmattorr
alexmattorr / button
Last active August 29, 2015 13:56
Interactive Button
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>How to create an animated css & javascript button!</title>
</head>
<style>
/*active affect gets rid of the box shadow and moves down 5px, this gives the impression (animation) of actually pushing a button.*/
#button:active {
/*
-----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
<[email protected]> wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return. -Michaël Sokol
-----------------------------------------------------------------------------
*/
@dhrrgn
dhrrgn / functions.php
Created March 3, 2014 16:02
Slugify. Note: Requires PHP >= 5.4 and the Intl extension
<?php
function slugify($string, $toLower = true) {
$rules = "Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove;";
if ($toLower) {
$rules .= ' Lower();';
}
$string = transliterator_transliterate($rules, $string);
// Remove repeating hyphens and spaces (e.g. 'foo---bar' becomes 'foo-bar')