Skip to content

Instantly share code, notes, and snippets.

@ju1ius
ju1ius / docker-reserved-tlds.md
Last active October 28, 2023 20:17
Using reserved TLDs for local development in Docker
@ju1ius
ju1ius / 2018-https-localhost.md
Created October 17, 2020 07:11 — forked from frank-dspeed/2018-https-localhost.md
How to create an HTTPS certificate for localhost domains

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).

Create a own domain (1-10 Domains No Wildcards)

edit /etc/hosts add my.

@ju1ius
ju1ius / wildcard-etc-hosts-network-manager.md
Last active May 15, 2024 14:01
Wildcard domains in /etc/hosts using NetworkManager
@ju1ius
ju1ius / dl-file.php
Created September 1, 2018 08:41 — forked from hakre/dl-file.php
Wordpress login to download uploaded files
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre <http://hakre.wordpress.com/>
* @license GPL-3.0+
@ju1ius
ju1ius / build_tf.sh
Created August 7, 2018 19:07 — forked from venik/build_tf.sh
Bash script for local building TensorFlow on Mac/Linux with all CPU optimizations (default pip package has only SSE)
#!/usr/bin/env bash
# Author: Sasha Nikiforov
# source of inspiration
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions
# Detect platform
if [ "$(uname)" == "Darwin" ]; then
# MacOS
@ju1ius
ju1ius / batchwords.sh
Last active February 22, 2021 15:52
Testing PREG_NO_UTF8_CHECK
#!/bin/bash
if [[ ! -d "$1" ]]; then
echo "Not a directory: $1"
exit 1
fi
find "$1" -type f | while read name
do
./php-src/sapi/cli/php ./words.php "$2" < "$name" >/dev/null
@ju1ius
ju1ius / index.js
Created January 22, 2016 17:33
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var mat4 = require('gl-mat4');
var interpolator = require('mat4-interpolator');
var inherits = require('inherits');
//
// Inlining mat4-css-parse & mat4-css-stringify here since RequireBin fails requiring them...
// nrmaliy we would just do
// var parseMatrix = require('mat4-css-parse');
@ju1ius
ju1ius / index.js
Created January 22, 2016 10:30
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var mat4 = require('gl-mat4');
var interpolator = require('mat4-interpolator');
var inherits = require('inherits');
//
// Inlining mat4-css-parse & mat4-css-stringify here since RequireBin fails requiring them...
// nrmaliy we would just do
// var parseMatrix = require('mat4-css-parse');
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping
xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xsi="http://www.w3.org/2001/XMLSchema-instance"
schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Application\Sonata\MediaBundle\Entity\Media"
table="media__media">
@ju1ius
ju1ius / gist:2688777
Created May 13, 2012 14:49
Xpath descendant benchmark
<?php
require 'Benchmark/Timer.php';
$timer = new Benchmark_Timer();
$nb_iterations = 1000;
/**
* BOOTSTRAP
**/