Skip to content

Instantly share code, notes, and snippets.

@drcharris
drcharris / userChrome.css
Created January 28, 2021 15:30
Firefox userChrome to mnimise wasted space when using Tree Style Tabs under Windows
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/*
STANDARD TST CONFIG
#sidebar-header - to hide the sidebar header
#TabsToolbar - hide just the tabs, leaving the window controls visible
push window controls down into the same vertical space as the tab bar
make the window controls roughly the same height as the nav-bar, saving window title space
{
"breadcrumbs.symbolSortOrder": "name",
"debug.onTaskErrors": "showErrors",
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.autoClosingQuotes": "never",
"editor.autoIndent": "full",
"editor.find.autoFindInSelection": "always",
"editor.fontFamily": "Hack",
"editor.fontSize": 12,
"editor.hover.delay": 600,
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* to hide the sidebar header */
#sidebar-header { visibility: collapse; }
#TabsToolbar .toolbar-items { visibility: collapse; } /* hide JUST the tabs, leaving JUST the window controls */
#TabsToolbar {
margin-bottom: -42px; /* push window controls down into same vertical space as the nav-bar */
height: 42px; /* make the window controls roughly the same height as the nav-bar */
}
@drcharris
drcharris / FWCam.cs
Created March 22, 2018 14:40
Adjust Cinemachine camera so that your screen width always matches a specific Unity units width.
using Cinemachine;
using UnityEngine;
/**
* Force the Cinemachine camera to make viewport exactly as wide as the bounding object.
* This allows us to always be 100% wide regardless of device. Handy for vertical scrollers.
*/
public class FWCam : MonoBehaviour {
public int fullWidthUnits = 14;
@drcharris
drcharris / app.js
Last active February 3, 2023 01:14
Fetch Evernote notes from a notebook using javascript
var async = require('async'); //async library to allow macro-wokr over async methods
var Evernote = require('evernote').Evernote; //the evernote client
var _ = require('lodash'); //handy utility function
/**
* @param token the authorisation token returned from your Evernote authentication
* @param bookGuid the unique identifier of the notebook
*/
function getNotesFromEvernote(token, bookGuid) {
//an evernote client object
@drcharris
drcharris / ConfigurableAssets.scala
Last active January 11, 2017 18:28
DEPRECATED - see https://gist.github.com/cessationoftime/b304c13f810f9d52e32fbf6c778af3d9 for updated version. Use different assets for different configurations with Play Framework
package controllers
import play.api.Play
import Play.current
import play.api.mvc.Action
import play.api.mvc.AnyContent
object ConfigurableAssets extends AssetsBuilder {
private val assetsPath = Play.configuration.getString("assets.path").getOrElse("/public")
def at(file:String): Action[AnyContent] = {