No Rights Reserved
Ce tutoriel est sous license CC0, vous pouvez le copier, le modifier, le redistribuer ou autre sans attribution à l'auteur, selon les termes de la license CC0: https://creativecommons.org/publicdomain/zero/1.0/legalcode.fr.
const COUNTRY_CURRENCY: { [key: string]: string } = { | |
BJ: "XOF", | |
BF: "XOF", | |
CD: "CDF", | |
CI: "XOF", | |
CG: "XAF", | |
CM: "XAF", | |
GA: "XAF", | |
GH: "GHS", | |
GN: "GNF", |
No Rights Reserved
Ce tutoriel est sous license CC0, vous pouvez le copier, le modifier, le redistribuer ou autre sans attribution à l'auteur, selon les termes de la license CC0: https://creativecommons.org/publicdomain/zero/1.0/legalcode.fr.
// 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 = {}; |
/* =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, |
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; |
<?php | |
/** | |
* Get a field by its id or slug | |
**/ | |
public static function get_by( $field, $value ) { | |
global $wpdb; | |
switch ( $field ) { | |
case 'id' : |
# 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 |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
<?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); |
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); |