Skip to content

Instantly share code, notes, and snippets.

View cezarpopa's full-sized avatar
:shipit:
A bit of this and a bit of that.

Cezar Popa cezarpopa

:shipit:
A bit of this and a bit of that.
View GitHub Profile
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@cakper
cakper / gist:1386347
Created November 22, 2011 17:47
Build.xml for Symfony2
<?xml version="1.0" encoding="UTF-8"?>
<project name="SS" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel"
@numist
numist / irsz.js
Created January 29, 2012 06:58
dynamically resize images to fit viewport (intelligently!)
/*
* Copyright © 2012 by Scott Perry
* Released under the MIT License; its terms are at the end of this file.
*
* This file depends on:
* • jQuery (tested against 1.7.1)
* http://jquery.com/
*
* Basic logic of this file:
* + if irsz_auto is true
@textarcana
textarcana / gjslint_help
Created October 7, 2012 19:27
Google Closure Linter command line options
USAGE: /usr/local/bin/gjslint [flags]
flags:
closure_linter.checker:
--closurized_namespaces: Namespace prefixes, used for testing
ofgoog.provide/require
(default: '')
(a comma separated list)
@DrewAPicture
DrewAPicture / clean_404_emails.php
Last active September 27, 2023 09:03
Original snippet by wp-mix.com at http://wp-mix.com/wordpress-404-email-alerts/ With the improved OOP style, implementation is a lot more straightforward, just add <?php new Clean_404_Email; to the top of your 404.php template.
<?php
// Just require() this class via your theme's functions.php file.
/* Then instantiate this at the top of your 404.php file with:
if ( class_exists( 'Clean_404_Email' ) )
new Clean_404_Email;
*/
class Clean_404_Email {
var $time, $request, $blog, $email, $theme, $theme_data, $site, $referer, $string, $address, $remote, $agent, $message;
@jessedc
jessedc / vimeo-js-api.html
Last active June 17, 2018 20:59
Autoplay Vimeo Videos from outside their iframe using Javascript.
<html>
<head></head>
<body>
<!-- NOTE: ?api=1 and player_id at the end of the URL -->
<iframe id="player" width="" height="" src="http://player.vimeo.com/video/62207569?api=1&player_id=player" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
<script>
var player = $f(document.getElementById('player'));
@pixelhandler
pixelhandler / pre-push.sh
Last active May 17, 2024 12:12
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@wsakaren
wsakaren / xdebug_php.ini
Created January 6, 2014 17:33
xdebug settings in php.ini
[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
@mikejolley
mikejolley / gist:8965846
Created February 12, 2014 22:29
WooCommerce 2.1 - Hiding product dimensions from the product page
// Add to your theme functions.php file
add_filter( 'wc_product_enable_dimensions_display', '__return_false' );
@niksumeiko
niksumeiko / gslint.conf
Created April 7, 2014 10:53
Sample Closure Linter configuration file used within WebStorm IDE
--strict
--jsdoc
--summary
--beep
--check_html
--nomultiprocess
--debug_indentation
--time