Skip to content

Instantly share code, notes, and snippets.

View tomasnorre's full-sized avatar
🐘

Tomas Norre Mikkelsen tomasnorre

🐘
View GitHub Profile
@tomasnorre
tomasnorre / Readme.md
Created February 12, 2022 13:21 — forked from Tuurlijk/Readme.md
Kitty theme switching based on the time of day

Kitty theme switching based on the time of day

I realy like the PHPStorm extension ChronoMorph which switches between light and dark themes depending on the time of day.

I wanted that for my terminal too. And since the kitty terminal can be remote controlled, we can implement this with two simple scripts.

One script fetches the sunrise and sunset times. It can run once a day.

The other one checks the current time against the sunrise and sunset times and determines if a light or dark mode should be used. It can run every five minutes or however often you like.

@tomasnorre
tomasnorre / webpack.config.js
Created January 6, 2021 19:17 — forked from bjo3rnf/webpack.config.js
Tailwind CSS in a Symfony Project with Webpack Encore and Purge CSS
const Encore = require('@symfony/webpack-encore');
const tailwindcss = require('tailwindcss');
const autoprefixer = require('autoprefixer');
const purgecss = require('@fullhuman/postcss-purgecss')({
content: [
'./templates/**/*.twig',
'./assets/js/**/*.vue',
'./assets/js/**/*.js',
@tomasnorre
tomasnorre / letsencrypt_2017.md
Created November 3, 2017 08:43 — forked from tolleiv/letsencrypt_2017.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

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

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@tomasnorre
tomasnorre / README.md
Created March 3, 2017 17:45 — forked from ralphschindler/README.md
Docker (For Mac) De-facto Host Address Alias (10.254.254.254) - "The 10254 Trick".

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254

Installation

Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

sudo curl -o /Library/LaunchDaemons/com.ralphschindler.docker_10254_alias.plist https://gist.githubusercontent.com/ralphschindler/535dc5916ccbd06f53c1b0ee5a868c93/raw/com.ralphschindler.docker_10254_alias.plist
@tomasnorre
tomasnorre / namespaceRefactor.php
Created February 18, 2016 12:36 — forked from hpbuniat/namespaceRefactor.php
Super-simple script to convert a existing project to use namespaces
<?php
/**
* Super-simple script to convert a existing project to use namespaces
*
* @author Hans-Peter Buniat <hpbuniat@googlemail.com>
* @copyright 2012 Hans-Peter Buniat <hpbuniat@googlemail.com>
* @license http://opensource.org/licenses/BSD-3-Clause
*/
class namespaceRefactor {
@tomasnorre
tomasnorre / commandline
Created October 6, 2015 19:15 — forked from sorenmalling/commandline
Installing TYPO3 CMS 7.4 with composer and typo3_console
# Just read the help
soren@kevin  ~/Sites/typo3-hyttekort  ./typo3cms help install:setup
Alpha version of a setup command. Use with care and at your own risk!
COMMAND:
typo3_console:install:setup
USAGE:
/Users/soren/Sites/typo3-hyttekort/./typo3cms ./typo3cms install:setup [<options>]