Skip to content

Instantly share code, notes, and snippets.

@mabasic
mabasic / helpers.php
Last active February 3, 2025 19:47
config_path function for Lumen framework
<?php
if ( ! function_exists('config_path'))
{
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/
@natebates
natebates / d3.layout.image-cloud.js
Last active April 26, 2016 07:45
Packed NBA Logos
// Word cloud layout by Jason Davies, http://www.jasondavies.com/word-cloud/
// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf
(function() {
function cloud() {
var size = [256, 256],
text = cloudText,
image = cloudImage,
imageScale = cloudImageScale,
font = cloudFont,
fontSize = cloudFontSize,
@parmentf
parmentf / GitCommitEmoji.md
Last active July 18, 2026 12:18
Git Commit message Emoji
@evantoli
evantoli / GitConfigHttpProxy.md
Last active July 14, 2026 08:37
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@diegonobre
diegonobre / symfony3-rest-api.md
Last active February 21, 2025 21:56 — forked from tjamps/README.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authenticationu
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :

@carlodaniele
carlodaniele / custom-queries.php
Last active December 14, 2024 10:36
An example plugin showing how to add custom query vars, rewrite tags and rewrite rules to WordPress
<?php
/**
* @package Custom_queries
* @version 1.0
*/
/*
Plugin Name: Custom queries
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@gabrielmerovingi
gabrielmerovingi / mycred-history-woo-my-account
Created October 2, 2017 12:28
myCRED history in WooCommerce "My Account" with pagination.
class My_Custom_My_Account_Endpoint {
/**
* Custom endpoint name.
*
* @var string
*/
public static $endpoint = 'my-custom-endpoint';
/**