Skip to content

Instantly share code, notes, and snippets.

View atinder's full-sized avatar

Atinder Singh atinder

View GitHub Profile
@atinder
atinder / cleanography-widgets
Created March 31, 2013 03:26
cleanography widgets updated
<?php
/**** WIDGETS AREA ****/
/* *****************************************************
* Plugin Name: Cleanography Recent Posts
* Description: Display Recent Posts with Thumbs.
* Version: 1.0
* Author: Atinder
* Author URI: http://www.atinder.com
@atinder
atinder / gist:5310153
Created April 4, 2013 12:59
alveera shortcodes updated
<?php
if ( !function_exists('at_remove_autop') ) {
function at_remove_autop($content) {
$content = do_shortcode( shortcode_unautop($content) );
$content = preg_replace( '#^<\/p>|^<br \/>|<p>$#', '', $content );
return $content;
}
@atinder
atinder / deploy.rb
Created August 19, 2013 06:07 — forked from chipotle/deploy.rb
# Capistrano Laravel 4 Deployment Tasks
# Watts Martin (layotl at gmail com)
# https://gist.github.com/chipotle/5506641
# updated 14-Aug-2013
# Assumptions:
#
# - You are using a .gitignore similar to Laravel's default, so your
# vendor directory and composer(.phar) are *not* under version control
# - Composer is installed as an executable at /usr/local/bin/composer
@atinder
atinder / gist:6279189
Last active December 21, 2015 08:38
BIR single-portfolio.php
<?php
global $at_options;
get_header(); ?>
<?php
if(have_posts()) : while(have_posts()) : the_post();
$page_meta = get_post_meta($post->ID,'page_meta',true);
$portfolio_meta = get_post_meta($post->ID,'portfolio_meta',true);
$images = get_post_meta($post->ID,'portfolio_images',true);
add this before
<!--.social-media-->
<?php if($at_options['pinterest'] != '') {?><li class="tt" data-toggle="tooltip" data-container="body" data-placement="left" title="<?php _e('Find us on Pinterest','at'); ?>"><a href="<?php echo $at_options['pinterest']; ?>" class="icon-pinterest"></a></li><?php } ?>
and in inc/theme-options.php
add this
<?php
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class ViewsCommand extends Command {
/**
* The console command name.
*
* @var string
@atinder
atinder / wp.sh
Last active August 29, 2015 14:06 — forked from samface/wp.sh
#!/bin/bash
# Exit this bash script if any statement returns a non-true return value (same as: set -e)
set -o errexit
if [ -z "$1" ]; then
echo
echo "ERROR: Must pass parameter of absolute or relative path to directory where Wordpress is to be installed."
echo "USAGE: $0 path/to/public/html/dir"
echo
@atinder
atinder / .bowerrc
Last active August 29, 2015 14:15 — forked from ericlbarnes/.bowerrc
{
"directory": "vendor/bower_components"
}
{{-- Define all our servers --}}
@servers(['staging' => '', 'production' => ''])
@setup
{{-- The timezone your servers run in --}}
$timezone = 'Europe/Amsterdam';
{{-- The base path where your deployments are sitting --}}
$path = '/var/www/site.com/htdocs';
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';