Skip to content

Instantly share code, notes, and snippets.

Ulrich Sossou sorich87

Block or report user

Report or block sorich87

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ng-controller-like-but-resolves
// NOT TESTED. Use with `<div my-controller="exampleCtrl" locals="{some: someVal, another: anotherVal}">`
angular.module('exampleApp', [])
.directive('myController', ['$controller', '$q', function ($controller, $q) {
return {
scope: true,
priority: 500,
link: function (scope, elem, attrs) {
var locals = scope.$eval(attrs.locals);
var promises = {};
@sorich87
sorich87 / style.css
Created Oct 18, 2012
Modified Twenty Eleven css file
View style.css
/* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html
-------------------------------------------------------------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
@sorich87
sorich87 / gist:2392858
Created Apr 15, 2012
Send WordPress emails via SMTP
View gist:2392858
function my_phpmailer_init( $phpmailer ) {
if ( ! defined( 'SMTP_HOST' ) )
return;
$phpmailer->IsSMTP();
$phpmailer->Host = SMTP_HOST;
$phpmailer->Port = defined( 'SMTP_PORT' ) ? SMTP_PORT : 25;
if ( defined( 'SMTP_USER' ) ) {
$phpmailer->SMTPAuth = true;
$phpmailer->Username = SMTP_USER;
View gist:1667864
<?php
/**
* Get a field by its id or slug
**/
public static function get_by( $field, $value ) {
global $wpdb;
switch ( $field ) {
case 'id' :
@sorich87
sorich87 / .gitignore
Created Dec 13, 2011 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
View .gitignore
# 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
@sorich87
sorich87 / about.md
Created Aug 10, 2011 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
View about.md
View gist:999145
<?php
function file_it($url) {
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $url);
$contents = curl_exec($c);
curl_close($c);
$file = basename($url);
@sorich87
sorich87 / gist:813342
Created Feb 6, 2011
WordPress Download and Extraction
View gist:813342
function file_it($url) {
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $url);
$contents = curl_exec($c);
curl_close($c);
$file = basename($url);
if ($contents) file_put_contents($file, $contents);
View gist:717889
<?php
/*
* Example code showing how to hook WordPress to add several fields to the taxonomny term edit screen.
* To-Do: Add field types other than text fields.
*
* Original author:
*
* Mike Schinkel (http://mikeschinkel.com/custom-wordpress-plugins/)
*
* NOTE:
View gist:662249
<?php
/*
* Hook WordPress to add a category field to a taxonomny term edit screen.
*
* Modified by Ulrich SOSSOU from:
*
* http://lists.automattic.com/pipermail/wp-hackers/2010-August/033671.html
*
* By:
*
You can’t perform that action at this time.