Skip to content

Instantly share code, notes, and snippets.

View JulienRAVIA's full-sized avatar
🎯
Focusing

Julien RAVIA JulienRAVIA

🎯
Focusing
View GitHub Profile
@jbalthis
jbalthis / footer.ajax.ex.html.twig
Created April 30, 2014 21:10
Example AJAX call via jQuery and a Twig template and using a GET request
@stormwarning
stormwarning / twitter-count.php
Created April 24, 2015 15:20
Get following/followers count of an Twitter account, without using 1.1 API
<?php
/**
* Get following/followers count of an Twitter account, without using 1.1 API
* @author Lancelot HARDEL
* @param username That's clear
* @param cache If you want to enable cache (or not)
* @param cachetime Time that the cachefile is valied
* @param stat_name you can use two values : followers, or following
* @return int
*/
@goreilly
goreilly / macros.twig
Created May 19, 2015 15:39
Twig HTML Select Macro with optgroups
{% macro select (name, id, options, selected, required, includeBlank) %}
<select name="{{ name }}" id="{{ id }}" {{ required ? 'required' : '' }}>
{% if includeBlank %}
<option value=""></option>
{% endif %}
{% for key, value in options %}
{% if value is iterable %}
<optgroup label="{{ key }}">
{% for subKey, subValue in value %}
<option value="{{ subKey }}" {{ subKey == selected ? 'selected' : '' }}>{{ subValue }}</option>
@vjt
vjt / passwdgen.js
Created March 29, 2012 16:52
Javascript Random Password Generator (jQuery)
// Demo: http://jsbin.com/emisib/5/edit#preview
//
// Markup:
//
// <input type="text" name="password" id="password" />
// <a href="#" class="passworder" data-length="10" data-target="#password">Generate</a>
//
// - vjt@openssl.it - public domain
//
(function () {
@mistic100
mistic100 / array_unique_deep.php
Last active January 25, 2020 12:14
[PHP] Extract unique values of the specified key in a two dimensional array
<?php
/**
* Extract unique values of the specified key in a two dimensional array
*
* @param array $array
* @param mixed $key
* @return array
*/
function array_unique_deep($array, $key)
{
@victorloux
victorloux / AppServiceProviders.php
Last active October 12, 2020 10:52
@Dump directive for Blade in Laravel 5
// place the following in app/Providers/AppServiceProviders.php, in the boot() method
/**
* Blade directive to dump a variable/object inside a template.
* This is similar to dd(), except that it doesn't interrupt the
* execution of the app. It does NOT support multiple arguments
* however, you have to use one directive per variable.
*
* @example @dump($posts->comments)
*/
@nasrulhazim
nasrulhazim / ForgotPasswordController.php
Last active May 20, 2021 11:41
Laravel: Forgot Password Controller for API
<?php
namespace App\Http\Controllers\Api\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Support\Facades\Password;
class ForgotPasswordController extends Controller
@amogram
amogram / chocolatey-env-setup.ps1
Last active August 17, 2021 14:19
A Chocolatey script for PowerShell I use to set up my Windows development environment. I use this when setting up my own Dev VMs. Use at your own risk.See http://bit.ly/1a301JK and http://chocolatey.org/ for more information.
# Simple environment setup script
# Install Applications
choco install fiddler4
choco install notepadplusplus
choco install visualstudiocode
choco install greenshot
choco install GoogleChrome
choco install putty
choco install ccleaner
@soifou
soifou / PHPBrew.md
Last active September 8, 2021 18:08
PHPBrew - Manage PHP versions efficiently

PHPBrew

Dependencies

$ apt-get install -y \
    autoconf automake curl libcurl3-openssl-dev build-essential libxslt1-dev \
    re2c libxml2 libxml2-dev bison libbz2-dev libreadline-dev \
    libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev libjpeg-dev libjpeg8-dev \
 libjpeg8 libgd-dev libgd3 libxpm4 libltdl7 libltdl-dev \