Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| install PostgreSQL 9 in Mac OSX via Homebrew | |
| Mac OS X Snow Leopard | |
| System Version: Mac OS X 10.6.5 | |
| Kernel Version: Darwin 10.5.0 | |
| Install notes for PostgreSQL 9.0.1 install using Homebrew: | |
| sh-3.2# brew install postgresql |
| #!/bin/sh | |
| echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
| read inputline | |
| name="$inputline" | |
| echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
| read inputline | |
| url="$inputline" |
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } |
| Brewhouse::Application.routes.draw do | |
| constraints(host: /^(?!www\.)/i) do | |
| match '(*any)' => redirect { |params, request| | |
| URI.parse(request.url).tap { |uri| uri.host = "www.#{uri.host}" }.to_s | |
| } | |
| end | |
| resource :drink_up, only: [:show] | |
| root :to => redirect('/drink_up') |
| <?php | |
| // php setup | |
| error_reporting(E_ALL); | |
| ini_set('display_errors', 'On'); | |
| date_default_timezone_set('America/Los_Angeles'); | |
| // | |
| // grab input data | |
| if (isset($_GET['max'])){ | |
| $max=$_GET['max']; |
| /* =BEGIN: Add Class to first Paragraph in WordPress the_content(); | |
| Source: http://wordpress.stackexchange.com/a/51682/28826 | |
| ---------------------------------------------------------------------------------------------------- */ | |
| function first_paragraph($content){ | |
| // Finding the 1st p tag and adding a class. | |
| $content = preg_replace('%<p([^>]+)?>%', '<p$1 class="intro">', $content, 1); | |
| // Finding the 1st closing p tag and adding a div tag to the rest of the content so we can separate it. | |
| $content = preg_replace('%</p>%', '</p> <div id="collapsable-content">', $content, 1); |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| <html> | |
| <head> | |
| <title>Pardot Example Form Handler Submit</title> | |
| <!-- Include jQuery --> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
| <!-- Post to Pardot function --> | |
| <script type="text/javascript"> | |
| // set the pardot form handler url and form element id |
| <?php | |
| /** | |
| * Looks up values from deep inside a container (object or array) in a safe way. | |
| * For example: | |
| * | |
| * lookup( | |
| * array('foo' => array('bar' => 'baz')), | |
| * array('foo', 'bar') | |
| * ) === 'baz' |
| /* Copyright (c) 2016 Tobias Buschor https://goo.gl/gl0mbf | MIT License https://goo.gl/HgajeK */ | |
| /* focusin/out event polyfill (firefox) */ | |
| !function(){ | |
| var w = window, | |
| d = w.document; | |
| if (w.onfocusin === undefined) { | |
| d.addEventListener('focus' ,addPolyfill ,true); | |
| d.addEventListener('blur' ,addPolyfill ,true); | |
| d.addEventListener('focusin' ,removePolyfill ,true); |