As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
| package utils | |
| import ( | |
| "runtime" | |
| "github.com/Sirupsen/logrus" | |
| ) | |
| // DecorateRuntimeContext appends line, file and function context to the logger | |
| func DecorateRuntimeContext(logger *logrus.Entry) *logrus.Entry { |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
This is a ServiceWorker template to turn small github pages into offline ready app.
Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js files). I wanted to cache these files so that I can access my tools offline as well.
Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS of your repository.
NetworkManager supports WiFi powersaving but the function is rather undocumented.
From the source code: wifi.powersave can have the following value:
- NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
- NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
- NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
| #!/usr/bin/env bash | |
| VERSION="0.0.2" | |
| SCRIPT_URL='https://gist.github.com/cubedtear/54434fc66439fc4e04e28bd658189701/raw' | |
| SCRIPT_DESCRIPTION="" | |
| SCRIPT_LOCATION="${BASH_SOURCE[@]}" | |
| rm -f updater.sh | |
| function update() | |
| { |
| #!/bin/bash | |
| # Call like you would `diff` | |
| # `./diff-changed-lines.sh old new` | |
| # Outputs the lines numbers of the new file | |
| # that are not present in the old file. | |
| # That is, outputs line numbers for new lines and changed lines | |
| # and does not output line numbers deleted or unchanged lines. |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "log" | |
| "regexp" | |
| ) |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

