Skip to content

Instantly share code, notes, and snippets.

View marcus-herrmann's full-sized avatar

Marcus Herrmann marcus-herrmann

View GitHub Profile
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@martinwolf
martinwolf / Preferences.sublime-settings
Last active October 8, 2015 19:18
Sublime Text 2 preferences
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"file_exclude_patterns":
[
".DS_Store",
"._*"
],
"folder_exclude_patterns":
@soffes
soffes / perferences.json
Created August 22, 2012 05:35
My Sublime Text 2 config
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"
],
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@christophengelmayer
christophengelmayer / Contract Killer 3.md
Last active November 25, 2023 10:24 — forked from malarkey/Contract Killer 3.md
Contract Killer 3 - German Translation / Deutsche Übersetzung von Contract Killer 3, einer Vertragsvorlage für Webdesign und -development Tätigkeiten.

Contract Killer 3 deutsch

Letzte Änderung: 21.01.2013

Zwischen uns [Unser Firmenname] und Ihnen [Name des Kunden]

Zusammenfassung:

Wir tun immer unser Bestes um Ihre Bedürfnisse und Erwartungen zu erfüllen, jedoch ist es wichtig Dinge niederzuschreiben damit jeder weiß, was was ist, wer was und wann tuen soll und was passiert wenn etwas schief läuft. In diesem Vertrage werden Sie keine komplizierten, in Juristensprache verfassten Geschäftsbedingungen oder lange Passagen von unleserlichem Text finden.

@LucaRosaldi
LucaRosaldi / get-browser-language-code.php
Last active February 24, 2022 10:13
PHP: Get Browser Language, optionally passing a list of available languages.
<?php
/**
* Get browser language, optionally passing a list of available languages.
*
* @param [array] $available_languages Available languages for the site
* @param [string] $default Default language for the site
* @return [string] Language code
*/
function get_browser_language_code( $available_languages = [], $default = 'en' ) : string
{
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); // Outputs "fr", "en", "es", etc...
@nicoknoll
nicoknoll / Guide.md
Last active August 29, 2015 14:04
Troubleshooting Processwire
@arjenblokzijl
arjenblokzijl / split-processwire-array.php
Last active May 16, 2018 07:33
Split WireArray/PageArray into chunks
<?php
// Thanks to netcarver > https://processwire.com/talk/topic/7803-implement-array-chunk/?p=75573
$items = $pages->find('#whatever'); // Find your stuff
$parts = 3; // How many items should there be in 1 chunk?
$chunked = array_chunk($items->getArray(), $parts);
foreach ($chunked as $chunk) {
foreach ($chunk as $item) {