Skip to content

Instantly share code, notes, and snippets.

View JulienRAVIA's full-sized avatar
🎯
Focusing

Julien RAVIA JulienRAVIA

🎯
Focusing
View GitHub Profile
@marcgg
marcgg / gist:733592
Created December 8, 2010 17:26
Regex to get the Facebook Page ID from a given URL
# Matches patterns such as:
# https://www.facebook.com/my_page_id => my_page_id
# http://www.facebook.com/my_page_id => my_page_id
# http://www.facebook.com/#!/my_page_id => my_page_id
# http://www.facebook.com/pages/Paris-France/Vanity-Url/123456?v=app_555 => 123456
# http://www.facebook.com/pages/Vanity-Url/45678 => 45678
# http://www.facebook.com/#!/page_with_1_number => page_with_1_number
# http://www.facebook.com/bounce_page#!/pages/Vanity-Url/45678 => 45678
# http://www.facebook.com/bounce_page#!/my_page_id?v=app_166292090072334 => my_page_id
# http://www.facebook.com/my.page.is.great => my.page.is.great
@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>
//
// - [email protected] - public domain
//
(function () {
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@spyl94
spyl94 / gist:3963465
Created October 27, 2012 08:00
Sublime Text 2 - Raccourcis utiles (Windows)

Sublime Text 2 – Raccourcis utiles (Windows)

Préambule

Voici une fiche mémo pour vous aider à retenir ces fameux raccourcis qui vont vous permettre de gagner en productivité. Prenez votre temps pour apprendre, il est généralement plus bénéfique de mémoriser un raccourci en lui associant une utilité tout en codant, plutôt que d’essayer de tout retenir d’un seul coup.
La notation Ctrl+KB signifie enfoncer les touches Ctrl et K simultanément puis relâcher K, enfoncer B tout en maintenant la touche Ctrl enfoncée.

Général

Ctrl+KB basculer la barre latérale
@SimonSimCity
SimonSimCity / pagination.html.twig
Last active September 30, 2023 17:29
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <[email protected]>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@phoenixg
phoenixg / header_http_status_codes.php
Created April 6, 2013 14:02
PHP header() for sending HTTP status codes
<?php
/*
参考自:
http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function
http://snipplr.com/view/68099/
*/
function HTTPStatus($num) {
$http = array(
@seanbuscay
seanbuscay / git_create_orphan.sh
Created June 27, 2013 15:26
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@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
@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)
{