Skip to content

Instantly share code, notes, and snippets.

View JulienRAVIA's full-sized avatar
🎯
Focusing

Julien RAVIA JulienRAVIA

🎯
Focusing
View GitHub Profile
@dfontana
dfontana / CmderZSH.md
Last active March 12, 2023 21:45
My setup guide for installing Cgywin, Mintty, Cmder, and ZSH.

What's this?

Instructions to obtain ZSH on a windows environment, without the input funny business presented by some other attempted solutions.

The final result is ZSH running on a mintty terminal, emulated by cygwin, and being handled by the popular cmder.

Why is this here?

For the benefit of myself and others. I've already followed these instructions twice. It took me hours to figure all this out, maybe someone else can save a few.

What exactly is covered?

  • Installing and setting up cmder
@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 \
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active May 6, 2024 14:31
Vanilla JavaScript Quick Reference / Cheatsheet
@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)
*/
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active May 7, 2024 11:05
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@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>
@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
*/
@CiprianSpiridon
CiprianSpiridon / Laravel-Blade-Template-Cheatsheet
Last active April 10, 2024 06:12
Laravel Blade Template Cheatsheet
{{ $var }} - Echo content
{{ $var or 'default' }} - Echo content with a default value
{{{ $var }}} - Echo escaped content
{{-- Comment --}} - A Blade comment
@extends('layout') - Extends a template with a layout
@if(condition) - Starts an if block
@else - Starts an else block
@elseif(condition) - Start a elseif block
@endif - Ends a if block
@FrostyX
FrostyX / FacebookDebugger.php
Last active February 9, 2022 11:15
Facebook API - Force facebook to reload cache from your website
<?php
class FacebookDebugger
{
/*
* https://developers.facebook.com/docs/opengraph/using-objects
*
* Updating Objects
*
* When an action is published, or a Like button pointing to the object clicked,
* Facebook will 'scrape' the HTML page of the object and read the meta tags.
@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