Skip to content

Instantly share code, notes, and snippets.

@jeromelebleu
jeromelebleu / moulinette-yunohost-from-git.sh
Last active January 22, 2016 19:59
Deploy development environment for YunoHost CLI & API
#!/bin/bash
set -e
set -x
if [ "$#" -ne "1" ]; then
echo "Usage: $0 DESTDIR"
exit 1
fi
@NicolasEhrhardt
NicolasEhrhardt / extractinfo.sh
Last active March 30, 2022 00:11
{OpenVPN, Freebox, Ubuntu} Script de reformatage du fichier de configuarion
#/bin/bash
# make output file
basedir=~/.openvpn
vpnconfigdir=$basedir/$2
mkdir -p $basedir
mkdir -p $vpnconfigdir
# print Gateway
sed -n 's/remote \([^ ]\+\) [0-9]\+/passerelle: \1/p' $1
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Jean-Pierre subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="innovation" title="innovation">
<outline type="rss" text="Pl4n3s world" title="Pl4n3s world" xmlUrl="http://pl4n3.blogspot.com/feeds/posts/default?alt=rss" htmlUrl="http://pl4n3.blogspot.com/"/>
<outline type="rss" text="Mozilla Hacks - the Web developer blog" title="Mozilla Hacks - the Web developer blog" xmlUrl="http://hacks.mozilla.org/feed/" htmlUrl="https://hacks.mozilla.org"/>
@pkuczynski
pkuczynski / parse_yaml.sh
Last active April 9, 2024 18:36
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@Mao8a
Mao8a / media-queries-based-on-bootstrap.less
Created January 8, 2014 23:13
LESS: MediaQueries based on bootstrap 3
/* media-queries.less */
/*
Deffined on variables.less from bootstrap
Large screen / wide desktop / screen >= 1200px
Medium screen / desktop / 992px >= screen < 1200px
Small screen / tablet / 768px >= screen < 992px
Extra small screen / phone / 480px >= screen < 768px
Very small screen / Outdated phone / screen < 480px
*/
/* Large screen & Biger */
@courgette
courgette / gist:8005576
Created December 17, 2013 14:18
[DRUPAL] ul to select for mobile device
Drupal.theme.ulToSelect = function(selector){
$(selector).once('ulToSelect', function(){
var ul = $(this),
select = '<select id="select"/>';
ul.after(select);
ul.find('li').each(function(){
var text = $(this).text(),
link = $(this).find('a').attr('href');
@chrisballinger
chrisballinger / gist:7239932
Last active May 14, 2024 18:52
French Encryption Import Compliance

Starting in the first week of July, apps that meet the following criteria are required to comply with French Encryption Laws/Regulations if you intend to distribute your app in France.

This requirement applies to apps that use, access, implement, or incorporate:

  1. Any encryption algorithm that is yet to be standardized by international standard bodies such as IEEE, IETF, ISO, ITU, ETSI, 3GPP, TIA, etc. or not otherwise published; or
  2. Standard (e.g., AES, DES, 3DES, RSA) encryption algorithm(s) instead of or in addition to accessing or using the encryption in iOS and/or Mac OS X

Apple will require you to upload a copy of your approved French declaration when you submit your app to the App Store. Relevant French encryption regulations can be found at:

@mledoze
mledoze / download-arte.tv-videos.md
Last active February 16, 2021 20:43
This tutorial explains how to download videos from http://www.arte.tv/

Edit 2021/02/16: warning

This gist is very old. I don't even know if it still works. Check the comments below to find more robust solutions, like youtube-dl for example, see this comment.

1

Go to http://www.arte.tv/ and select any videos, for example http://www.arte.tv/guide/fr/046618-011/silex-and-the-city

2

In the source code extract the src parameter of the iframe player:

http://www.arte.tv/player/v2/index.php?json_url=http%3A%2F%2Farte.tv%2Fpapi%2Ftvguide%2Fvideos%2Fstream%2Fplayer%2FF%2F046618-011_PLUS7-F%2FALL%2FALL.json&lang=fr_FR&config=arte_tvguide&rendering_place=http://www.arte.tv/guide/fr/046618-011/silex-and-the-city

@DuaelFr
DuaelFr / gist:6884247
Created October 8, 2013 12:55
jQuery event resize with timer for performances
function myfunction() {
// Do sth on resize.
}
$(function() {
var intervalId;
$(window).resize(function(e) {
clearTimeout(intervalId);
intervalId = setTimeout(myfunction, 200);
});
@konklone
konklone / ssl.rules
Last active May 19, 2024 18:02
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {