Skip to content

Instantly share code, notes, and snippets.

Cecile Muller cecilemuller

Block or report user

Report or block cecilemuller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cecilemuller
cecilemuller / get_combinations.php
Created Feb 1, 2013
PHP: Get all combinations of multiple arrays (preserves keys)
View get_combinations.php
<?php
function get_combinations($arrays) {
$result = array(array());
foreach ($arrays as $property => $property_values) {
$tmp = array();
foreach ($result as $result_item) {
foreach ($property_values as $property_value) {
$tmp[] = array_merge($result_item, array($property => $property_value));
}
@cecilemuller
cecilemuller / letsencrypt_2019.md
Last active Feb 22, 2020
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2019.md

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@soarez
soarez / ca.md
Last active Feb 21, 2020
How to setup your own CA with OpenSSL
View ca.md

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active Feb 20, 2020
How to create an HTTPS certificate for localhost domains
View 2019-https-localhost.md

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@n1k0
n1k0 / 404checker.js
Created Jan 11, 2013
A CasperJS script to check for 404 & 500 internal links on a given website
View 404checker.js
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
@toji
toji / motion-controllers-example.js
Created Jan 23, 2020
Using motion-controllers.modules.js
View motion-controllers-example.js
// A barebones example of how to use the motion-controllers library and assets repository to load controller models in yor WebXR app
// This gist will not go into the details of how to set up a WebXR app (See https://immersive-web.github.io/webxr-samples/ for that)
// but will instead focus on the parts needed to find and load the appropriate controller.
// The motion-controllers library is small enough that it can easily be dropped into your own codebase if you wish, but loading it
// directly from a CDN like jsdelivr is an even easier route to getting up and running.
import { fetchProfile } from 'https://cdn.jsdelivr.net/npm/@webxr-input-profiles/motion-controllers@1.0.0/dist/motion-controllers.module.js';
// The assets package (https://www.npmjs.com/package/@webxr-input-profiles/assets) is larger, about 67Mb at time of writing,
// so it may be more beneficial to always use a CDN for it, especially since that will enable your app to pick up new controllers
@cecilemuller
cecilemuller / index.html
Last active Jan 8, 2020
Record three.js to WebM video using CCapture.js
View index.html
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Record WebGL to WebM (Chrome only)</title>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css" charset="utf-8">
</head>
<body>
<div class="buttons">
@scottjehl
scottjehl / noncritcss.md
Last active Dec 25, 2019
Comparing two ways to load non-critical CSS
View noncritcss.md

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@cecilemuller
cecilemuller / example.html
Last active Nov 25, 2019
Better underlines, especially on Retina
View example.html
<p>
Lorem ipsum consectetur <a href="#">simple basic link paqejigu</a> adipisicing
elit aut <a class="enhanced" href="#">simple enhanced link paqejigu</a> aut officia
adipisci nemo perferendis eveniet delectus ipsam consectetur. Molestiae, iste
ipsa sit aliquid quasi quidem ab? Enim veritatis architecto commodi!
</p>
<p>
Lorem ipsum consectetur <b><a href="#">bold basic link paqejigu</a></b> adipisicing
elit aut <b><a class="enhanced" href="#">bold enhanced link paqejigu</a></b> officia
@dustinmm80
dustinmm80 / multivm_vagrant_dry.md
Created Sep 15, 2013
An example of how to write Vagrantfiles following the DRY principle.
View multivm_vagrant_dry.md
=begin
Example box JSON schema
{
    :name => :name_of_vagrant_box, #REQUIRED
    :ip => '10.0.0.11', #REQUIRED
    :synced_folders => [
        { '.' => '/home/vagrant/myapp' }
    ],
    :commands => [
You can’t perform that action at this time.