Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
This file contains 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
app.filter "truncateText", -> | |
(string, maxLength, wordsafe = false, addEllipsis = false, minWordsafeLength = 1) -> | |
ellipsis = '' | |
maxLength = Math.max(maxLength, 0) | |
minWordsafeLength = Math.max(minWordsafeLength, 0) | |
# Remove HTML tags | |
string = string.replace(/<(?:.|\n)*?>/gm, '') | |
# No truncation needed, so don't add ellipsis, just return. |
This file contains 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
#!/usr/bin/env bash | |
# Idea and interface taken from https://github.com/macmade/host-manager | |
path="/etc/hosts" | |
addusage="Usage: `basename $0` -add host address" | |
remusage="Usage: `basename $0` -remove host" | |
case "$1" in | |
-add) | |
if [ $# -eq 3 ]; then | |
if [[ -n $(grep "^$3.*[^A-Za-z0-9\.]$2$" ${path}) ]]; then |
This file contains 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
#!/usr/bin/env bash | |
# For OSX. Assumes you have drush, git, mysql, apache, and Chrome installed. | |
# Usage: ./setup-drupal.sh cool-app 7 | |
SITE=$1 | |
VERSION=$2 | |
DIR="~/Development/sites/$SITE" |
This file contains 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 | |
# usage: drupal-quick-dump user host database | |
USER="$1" | |
HOST="$2" | |
DB="$3" | |
DATE=`date +%Y%m%d` | |
# Get User Password | |
echo "Please provide the password for ${USER} on db ${DB} hosted at ${HOST}:" |
This file contains 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 | |
# --- Required variables --- | |
RSS_URI="/rss" | |
MAIL_TO="your@email.com" | |
LOG_FILE="/var/log/httpd/access_log" | |
LOG_DATE_FORMAT="%d/%b/%Y" | |
# --- Optional customization --- |
This file contains 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
#!/usr/bin/env perl | |
# Feed this script an android_report csv file. | |
# Note: Requires Text::CSV_XS | |
use strict; | |
use warnings; | |
use Text::CSV_XS; | |
use File::Basename; |
This file contains 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
#!/usr/bin/env ruby | |
# dds.rb -- DrupalCon Denver Schedule | |
# Create a printer friendly schedule of your DrupalCon Denver sessions | |
# Usage: ./dds.rb YOURID | |
# For example: ./dds.rb 34143 | |
require 'nokogiri' | |
require 'open-uri' | |
user_id = ARGV[0] |
This file contains 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
# Check for drush on your remote server(s) | |
depend :remote, :command, "drush" | |
# A couple of custom tasks I use to fix some things. You may add or modify | |
# anything in this file. | |
before 'deploy:symlink', 'drupal:symlink:webapp' | |
after 'deploy:symlink', 'drupal:configure:settings' | |
after 'deploy:rollback', 'drupal:symlink:webapp' | |
namespace :drupal do |
This file contains 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
require 'rubygems' | |
require 'drupal-deploy' | |
load File.join(File.dirname(__FILE__), 'config', 'lib', 'deploy') | |
# The name of your Drupal site | |
set :application, "sandbox" | |
# The user that will own the files directory | |
set :web_user, "apache" |
NewerOlder