This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* =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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #SingleInstance force | |
| EmptyRecycleBin() | |
| { | |
| MsgBox, 4,, Clear Recycle Bin? | |
| IfMsgBox Yes | |
| FileRecycleEmpty | |
| } | |
| #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // prerequisite: npm install twitter fs-extra delay | |
| const Twitter = require('twitter'); | |
| const fs = require('fs-extra'); | |
| const delay = require('delay'); | |
| var client = new Twitter({ | |
| consumer_key: 'WRITE', | |
| consumer_secret: 'YOUR', | |
| access_token_key: 'APP', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| global $acf_recalc_settings; | |
| // IMPORTANT: Customize these settings for your website. | |
| $acf_recalc_settings = array( | |
| // How many updates to do each page load. As of November 2018, Google's GeoLocation API limit is 100 per second. | |
| 'posts_per_run' => 16, | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| export PS4='+[$(date -u)][${BASH_SOURCE}:${LINENO}]: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'; set -x; | |
| if [ `id -u` -ne 0 ]; then | |
| echo "Rippling uninstall must be run by root" | |
| exit 1 | |
| fi | |
| sudo launchctl unload /Library/LaunchDaemons/com.rippling.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" |
OlderNewer