Skip to content

Instantly share code, notes, and snippets.

View pixeline's full-sized avatar
😄
Heaven, I'm in heaven, And my heart beats so that I can hardly speak !

Alexandre Plennevaux pixeline

😄
Heaven, I'm in heaven, And my heart beats so that I can hardly speak !
View GitHub Profile
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@zircote
zircote / ssh.sh
Created September 26, 2011 21:45
Convert a AWS PEM into a ssh pub key
ssh-keygen -y -f private_key1.pem > public_key1.pub
@mattboon
mattboon / gist:1275191
Created October 10, 2011 12:32
WordPress - Query Custom Post Type and taxonomy term by ID
<?php
// gets the ID from a custom field to show posts on a specific page
$buildType = get_post_meta($post->ID, 'build_type_id', true);
// run query
query_posts(array(
'post_type' => 'portfolio',
'showposts' => -1,
'tax_query' => array(
array(
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@ericrasch
ericrasch / first-paragraph-class.php
Created March 29, 2012 21:26
WordPress: Add Class to first Paragraph in WordPress the_content; (add this to the functions.php in your Theme)
<?php
/* =BEGIN: Add Class to first Paragraph in WordPress the_content();
Source: http://webdevbits.com/wordpress/add-class-to-first-paragraph-in-wordpress-the_content/
---------------------------------------------------------------------------------------------------- */
function first_paragraph($content){
// Testing to see if the content is a Page or Custom Post Type of school, if so, display the text normally (without the class = intro).
if ( is_page() || ('school' == get_post_type() ) ) {
return preg_replace('/<p([^>]+)?>/', '<p$1>', $content, 1);
} else {
return preg_replace('/<p([^>]+)?>/', '<p$1 class="intro">', $content, 1);
@fideloper
fideloper / vhost.py
Last active January 25, 2024 23:37
Create vHost Ubuntu Lamp-Server (bash and python)
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@JoostKiens
JoostKiens / functions.php
Last active April 22, 2019 09:58
Improve the WordPress caption shortcode with HTML5 figure & figcaption, microdata & wai-aria attributes
<?php
/**
* Improves the WordPress caption shortcode with HTML5 figure & figcaption, microdata & wai-aria attributes
*
* Author: @joostkiens
* Licensed under the MIT license
*
* @param string $val Empty
* @param array $attr Shortcode attributes
* @param string $content Shortcode content
@fjarrett
fjarrett / gist:5544469
Last active June 17, 2019 16:13
Return an attachment ID using a URL in WordPress
<?php
/**
* Return an ID of an attachment by searching the database with the file URL.
*
* First checks to see if the $url is pointing to a file that exists in
* the wp-content directory. If so, then we search the database for a
* partial match consisting of the remaining path AFTER the wp-content
* directory. Finally, if a match is found the attachment ID will be
* returned.
*
@adamcbrewer
adamcbrewer / node.sh
Created July 23, 2013 08:38
NODE: Run a daemon node.js server and create virtualhost to forward all site traffic to the specified port.
# This command will make sure the process persists
# even after you log out of a session
node server.js >/dev/null 2>&1 &