When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}| # install pygit2: pip install pygit2 | |
| import pygit2 | |
| import json | |
| repo = pygit2.Repository('path/to/repository') | |
| last = repo[repo.head.target] | |
| data = [] | |
| for commit in repo.walk(last.id): |
| # Define ULID_DECODE and ULID_ENCODE which convert a ulid string to a binary and vice versa. | |
| delimiter // | |
| DROP FUNCTION IF EXISTS ULID_DECODE// | |
| CREATE FUNCTION ULID_DECODE (s CHAR(26)) RETURNS BINARY(16) DETERMINISTIC | |
| BEGIN | |
| DECLARE s_base32 CHAR(26); | |
| SET s_base32 = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(s), 'J', 'I'), 'K', 'J'), 'M', 'K'), 'N', 'L'), 'P', 'M'), 'Q', 'N'), 'R', 'O'), 'S', 'P'), 'T', 'Q'), 'V', 'R'), 'W', 'S'), 'X', 'T'), 'Y', 'U'), 'Z', 'V'); | |
| RETURN UNHEX(CONCAT(LPAD(CONV(SUBSTRING(s_base32, 1, 2), 32, 16), 2, '0'), LPAD(CONV(SUBSTRING(s_base32, 3, 12), 32, 16), 15, '0'), LPAD(CONV(SUBSTRING(s_base32, 15, 12), 32, 16), 15, '0'))); | |
| END// |
| [alias] | |
| ; creates timestamped branch rst-XXXXX and pushes it to default remote (origin) | |
| rst = "!rst() { export tmpBranch=rst-$(date +%s) && git add -A && git checkout -b $tmpBranch && git commit -m 'WIP remote stash' && git push --set-upstream origin $tmpBranch; }; rst" |
| <?php | |
| /** | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) Ozgur (Ozzy) Giritli <[email protected]> | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights |
| server { | |
| listen 80; | |
| server_name example.com; | |
| root d:/webs/example.com/www; | |
| index index.php index.html; | |
| try_files $uri $uri/ /index.php?$args; | |
| location ~ \.phpt?$ { | |
| try_files $uri @missing; |
Easy peasy parallax effect
A Pen by Daniel Riemer on CodePen.
| <!doctype html> | |
| <script> | |
| if ("WebSocket" in window) { | |
| var ws = new WebSocket("ws://127.0.0.1:31339"); | |
| ws.onopen = function() { | |
| console.log('connected'); | |
| }; | |
| ws.onerror = function(e) { |
| #! /bin/bash | |
| MYSQL="/opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper" | |
| NGINX="/opt/local/sbin/nginx" | |
| PHPFPM="/opt/local/sbin/php-fpm" | |
| PIDPATH="/opt/local/var/run" | |
| MEMCACHED="/opt/local/bin/memcached -m 24 -P /opt/local/var/run/memcached.pid -u root" | |
| if [ $1 = "start" ]; then | |
| sudo $MYSQL start | |
| echo "Starting php-fpm ..." |
| server { | |
| index index.php; | |
| set $basepath "/var/www"; | |
| set $domain $host; | |
| # check one name domain for simple application | |
| if ($domain ~ "^(.[^.]*)\.dev$") { | |
| set $domain $1; | |
| set $rootpath "${domain}"; |