Skip to content

Instantly share code, notes, and snippets.

View born2discover's full-sized avatar
🏠
Working from home

born2discover

🏠
Working from home
  • Switzerland
  • 04:32 (UTC +02:00)
View GitHub Profile
@born2discover
born2discover / RandomColors.php
Last active December 21, 2015 12:39 — forked from bastianallgeier/hsl.php
This script allows generation of random colours for CSS markup.
<?php
/**
* A simple php script to generate random CSS colors at each request.
*/
$hsl = rand(0, 240) . ',' . rand(50, 80) . '%,60%';
?>
<style type="text/css">
a {
color: hsl(<?php echo $hsl ?>);
@born2discover
born2discover / pelican-yearly-archives.html
Created July 9, 2015 16:03
Yearly archives for Pelican static site generator.
{% for year, date_year in dates|groupby( 'date.year' )|sort(reverse=True) %}
<h2 class="title" id="{{year}}">{{year}}</h2>
<ul class="year">
{% for article in date_year %}
<li>
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a>
<time datetime="{{ article.date.isoformat() }}" pubdate>{{ article.locale_date }}</time>
</li>
{% endfor %}
</ul>
@born2discover
born2discover / 3-hidden-css-tips.md
Created August 23, 2016 14:50 — forked from nepsilon/3-hidden-css-tips.md
3 hidden CSS tips — First published in fullweb.io issue #62

3 hidden CSS tips

1. Use empty-cells to style table empty cells:

Surprisingly the browser support is quite good and extends back to IE8. Convenient to give less visual predominance to empty cells.

table {
  empty-cells: hide;
}
@born2discover
born2discover / foo.log
Created September 5, 2016 16:40 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
@born2discover
born2discover / ampersand.html
Created December 12, 2017 20:48 — forked from mrinalwadhwa/ampersand.html
Ampersand — Goudy Bookletter 1911
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Ampersand</title>
<style>
@font-face {
font-family:"Goudy Bookletter 1911";
src:url('http://themes.googleusercontent.com/static/fonts/goudybookletter1911/v3/l5lwlGTN3pEY5Bf-rQEuIHkY3soKkPv_thL__S829Cw.eot#iefix') format('embedded-opentype'),
@born2discover
born2discover / dokku-kirby-autogit.md
Created December 21, 2017 01:33 — forked from woudsma/dokku-kirby-autogit.md
Dokku + Kirby + AutoGit

TL;DR

  • Configure Kirby for Dokku
  • Install deployment-keys and host keys Dokku plugins
  • Set up staging and production environments
  • Clone project repository into apps persistent storage folders
  • Mount desired folders including .git folder to apps
  • Add GIT_DIR and GIT_WORK_TREE environment variables to containers
  • Deploy to Dokku
<?php
class BasicTwigExtension extends \Twig_Extension {
/**
* Internal Twig function for getting extension name.
*
* @return string
*/
public function getName() {
return 'BasicTwigExtension';
@born2discover
born2discover / bobp-python.md
Created May 28, 2018 12:07 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@born2discover
born2discover / getBlockLists.sh
Created September 18, 2018 12:23 — forked from gombosg/getBlockLists.sh
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Link good as of June 2018
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*\?list=.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'