Skip to content

Instantly share code, notes, and snippets.

View benfavre's full-sized avatar
💻
At the office

Webdesign29 benfavre

💻
At the office
View GitHub Profile
@phbergsmann
phbergsmann / gist:9975380
Created April 4, 2014 14:04
NGINX configuration for TYPO3 with HHVM and PHP-FPM Fallback
server {
listen 80;
server_name localhost;
root /var/www;
client_max_body_size 32M;
location = /clear.gif {
empty_gif;
expires max;
@lub
lub / leagueoflegends
Last active August 29, 2015 14:02 — forked from anonymous/leagueoflegends
Launch League of Legends, wait until it is patched, run tuxlol -> success
#!/bin/sh
# --- README ---
# adjust paths and launch command (replace playonlinux if needed)
# get tuxlol https://bitbucket.org/Xargoth/tuxlol/downloads
# get mono: apt-get install mono-runtime libmono-system-core4.0-cil
playonlinux --run "League of Legends"
until ps aux | grep -v grep | grep LolClient
@angelodlfrtr
angelodlfrtr / world_country_boundaries.geojson.json
Created August 6, 2014 13:47
Limite des pays du monde en geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@angelodlfrtr
angelodlfrtr / Countries.json
Last active August 29, 2015 14:04
Coutries in Json with lat and lng
[
{
"name": "Afghanistan",
"alpha_2_code": "AF",
"alpha_3_code": "AFG",
"numeric_code": "4",
"lat": "33",
"long": "65",
"dial_code": "+93"
},
@benfavre
benfavre / -README.md
Created February 19, 2016 17:44 — forked from jirutka/-README.md
How to use terminal on Windows and don’t go crazy…

How to use terminal on Windows without going crazy…

Windows is really horrible system for developers and especially for devops. It doesn’t even have a usable terminal and shell, so working with command line is really pain in the ass. If you really don’t want to switch to any usable system (OS X, Linux, BSD…), then this guide should help you to setup somewhat reasonable environment – usable terminal, proper shell, ssh client, git and Sublime Text as a default editor for shell.

Install stuff

  1. Download and install Git for Windows* with:
    • [✘] Use Git from the Windows Command Prompt
  • [✘] Checkout as-is, commit Unix-style line endings
@cparker15
cparker15 / extjs4-dynamic-grid-example.html
Created November 19, 2011 23:41
Ext JS 4 Dynamic Grid Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Ext JS Grid Example</title>
<script src="http://cdn.sencha.io/ext-4.0.7-gpl/ext-all.js"> </script>
<link rel="stylesheet" href="http://cdn.sencha.io/ext-4.0.7-gpl/resources/css/ext-all.css" />
@benfavre
benfavre / .js
Created September 5, 2016 15:59
Serialize Form to JSON
(function ($) {
$.fn.serializeFormJSON = function (options) {
options = jQuery.extend({}, options);
var self = this,
json = {},
push_counters = {},
patterns = {
"validate": /^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,
@thomasyip
thomasyip / gen.sh
Created July 4, 2015 22:52
Generate self-signed alternate dns (wildcard) ssl certificate with a single script
#!/bin/bash
# file: gen.sh
# usage: ./gen.sh [name]
ROOT=rootCA
NAME=${1:-device}
EXTS=( key cnf csr crt )
ROOT_NAME=rootCA
ROOT_EXTS=( key pem )
@angelodlfrtr
angelodlfrtr / siret_to_tva_fr.rb
Last active February 13, 2017 14:44
SIRET to no TVA
class String
# SIRET or SIREN to French VAT number
def to_tva
siren = self[0..8].to_i
cle_tva = (((siren % 97) * 3) + 12) % 97
(cle_tva < 10) ? "FR0#{cle_tva} #{siren}" : "FR#{cle_tva} #{siren}"
end
end
@adeelejaz
adeelejaz / jquery.browser.js
Last active January 9, 2018 18:15
jQuery $.browser as a separate file in case you do not want to include the full migration file
(function( jQuery, window, undefined ) {
"use strict";
var matched, browser;
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||