Instantly share code, notes, and snippets.

🇫🇷
Cocorico

Pierre de la Martinière martpie

View GitHub Profile
@martpie
martpie / cockpit
Created Mar 12, 2018
cockpit-test
View cockpit
server {
listen 80;
server_name localhost;
root /var/www/html;
index index.html index.htm;
location / {
try_files $uri /index.html;
autoindex on;
}
@martpie
martpie / cockpit
Last active Mar 12, 2018
Cockpit nginx config
View cockpit
# stolen from https://github.com/COCOPi/cockpit-docs/blob/master/tutorials/nginx.md
server {
listen 80;
server_name _;
root /var/www/html;
index index.php index.html index.htm;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
@martpie
martpie / small-js-exercises.js
Last active Jan 19, 2018
Small JS exercises
View small-js-exercises.js
/**
* Small JS exercices
* Consider all exercises independant from each other and running in their own scope
*
*/
/**
* What is the output of this piece of code?
*
*/
@martpie
martpie / keymap.cson
Last active May 24, 2018
Get emmet-atom working fine with Atom and autocomplete-plus
View keymap.cson
# Pierre de la Martinière - http://pierrevanmart.com
# Will make autocomplete trigger with 'enter' instead of 'tab'
'atom-text-editor:not(mini) .autocomplete-plus.autocomplete-suggestion-list':
'tab': 'unset!'
'enter': 'autocomplete-plus:confirm'
# Use 'expand-abbreviation' instead of 'expand-abbreviation-with-tab' for tab keybinding
'.pane .editor:not(.mini)':
@martpie
martpie / gmaps.html
Created Aug 20, 2014
Google Maps v3 API snippet
View gmaps.html
<!-- Map -->
<div id="map_canvas" class="relative" style="height:600px;z-index: 4;"></div>
<!-- Maps Generator -->
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script>
window.onload = function() {
initialize();
}
View Custom language menu for WPML.php
/* Pierre de la Martinière
*
* display all languages avalaible for a Wordpress Theme using WPML
* directly echo something like "en fr it ru" ...
*
* more info at http://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/
*
*/
//[wpml_lang_selector]