Skip to content

Instantly share code, notes, and snippets.

View johanoloflindberg's full-sized avatar
💭
Ready to work 😃

WEBBAB johanoloflindberg

💭
Ready to work 😃
View GitHub Profile
@alangrafu
alangrafu / gist:3935573
Created October 22, 2012 23:41
Template (html.template)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example 3</title>
</head>
<body>
<h2>Largest cities by area</h2>
{{models.main|GoogleMaps:"latitude,longitude,areaAndName,width=900,height=500"}}
</body>
@jmslbam
jmslbam / setup.sh
Created November 1, 2012 22:58
Wordpress wp-cli install bash
#!/bin/bash
#
# This script has been adapted from the drush wrapper script
# and all credit should go to the authors of that project:
# http://drupal.org/project/drush
# Get the absolute path of this executable
ORIGDIR=$(pwd)
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
@jmslbam
jmslbam / settings.php
Created November 3, 2012 22:51
Settings.php
<?php
$settings = array(
'DB_HOST' => 'localhost',
'DB_NAME' => '%DBNAME%',
'DB_USER' => '%DBUSER%',
'DB_PASSWORD' => '%DBPASS%',
'DOMAIN_CURRENT_SITE' => '%SITEURL%',
'WP_DEBUG' => TRUE,
'ENVIRONMENT' => 'dev',
'ACF_REPEATER' => "",
@vitorbritto
vitorbritto / devlist-bookmarks.md
Last active October 10, 2023 13:49
A BADASS list for faster Web Development! Recently, I decided to organize my bookmarks. So, like a good fellow, I am sharing with you. I hope you enjoy!

Dev List Bookmarks

Attention: the list was moved to https://github.com/vitorbritto/dev-list

This page is not maintained anymore, please update your bookmarks.


Recently, I decided to organize my bookmarks. So, like a good fellow, I am sharing with you. I hope you enjoy!

@ericrasch
ericrasch / Collapsable Content functions.php
Last active July 4, 2017 03:55
Create collapsable content sections using WordPress' the_content().
/* =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);
@tommaitland
tommaitland / form.html
Last active January 1, 2024 09:55
A form with every HTML form element (up to HTML5) for styling.
<form action="/">
<legend>A Sample Form Legend</legend>
<label for="name">Name: </label>
<input type="text" value="Name" name="Name" />
<label for="email">Email: </label>
<input type="email" value="Email" name="Email" />
@germanny
germanny / using-the-seo-plugin-to-the-max.md
Last active July 4, 2017 03:52
Google Plus stuff and PHP constants defined for Facebook Page ID, G+ Author Page, and Twitter Username from Yoast SEO plugin

Constants defined for Facebook Page ID, G+ Author Page, and Twitter Username

Using the Social fields in the SEO Plugin, we don't have to enter this data into the theme too:

/**
* Use Yoast SEO Plugin to create these constants
* http://wordpress.org/plugins/wordpress-seo/
* https://gist.github.com/germanny/6222479
*/
@jmslbam
jmslbam / wp-cli-snippets.sh
Last active July 8, 2017 03:00
WP-CLI snippet solutions collected from WP-CLI issues
#!/bin/bash
# Provide a way to upgrade the network after `wp core update`
# https://github.com/wp-cli/wp-cli/issues/683
for url in $(wp site list --fields=url --format=csv | tail -n +2)
do
wp --url=$url core update-db
done
@vitorbritto
vitorbritto / setup_vitorbritto_workspace.md
Last active June 22, 2019 02:48
My Workspace Setup

Setup - My Workspace

This is my workspace reference documentation in case I need to install and prepare it again. Is up to you (me) if you want to run this step by step. Use it wiselly. =]

1. Backup

  • Desktop
  • Projects
  • Transfers
  • Documents
@ajmorris
ajmorris / gist:7540224
Created November 19, 2013 04:13
Sample Bash WP-cli install
#First, name and create a subfolder:
printf "In which folder should we install WordPress? "
read NEWDIR
mkdir $NEWDIR
#Install WordPress and create the wp-config.php file...
#Also; we'll be loading the dutch localized version of WP
#We add the --force since this is a new folder
cd $NEWDIR