Skip to content

Instantly share code, notes, and snippets.

@bherbst
bherbst / Colors.kt
Created April 1, 2021 18:14
Style Dictionary - Compose Dark Mode
package com.example.tokens
import androidx.compose.ui.graphics.Color
class Colors(
val textPrimary: Color,
val textSecondary: Color,
val textInverse: Color,
val textSecondaryInverse: Color,
)
@VladimirPal
VladimirPal / neomuttrc
Last active March 30, 2024 11:59
Minimal neomutt config for gmail imap
set imap_user="mail.vpal@gmail.com"
set imap_pass=`/usr/bin/security find-generic-password -w -a 'mail.vpal@gmail.com' -s 'Gmail'`
set folder=imaps://imap.gmail.com/
set spoolfile=+INBOX
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
# https://www.neomutt.org/guide/reference search sleep_time for additional info
set sleep_time=0 # be faster
@petedoyle
petedoyle / gist:4129668
Last active January 29, 2021 08:19
Notes: OpenWRT / Codel on TL-WDR4300

Overview

I'm tired of massive delay (500-1000 ms pings) while uploading large files. QoS helps some, but a significant portion remains due to bufferbloat (100-150ms). This leads to delay in VoIP calls and generally sluggish web browsing while uploading.

The new Codel algorithm in OpenWRT / Attitude Adjustment should help a lot. The results below show only ~5-6ms of added latency during uploads (i.e. 14ms vs 500+ms before!). Insane.

These instructions are for the TP-Link TL-WDR4300, because I got a good deal. If you have the money, buy a Netgear WNDR3800 and install CeroWRT, you'll probably see even better results.

Why the TP-Link TL-WDR4300

In short, its fully supported in OpenWRT Attitude Adjustment and works well for my needs:

  • Cheap
@outdooricon
outdooricon / DomainFilters.groovy
Created May 3, 2011 15:47
Strip all requests with www subdomain and 301 redirect.
class DomainFilters {
def filters = {
wwwCheck(uri:'/**') {
before = {
if (request.getServerName().startsWith("www.")) {
int port = request.getServerPort();
if (request.getScheme().equals("http") && port == 80) {
port = -1;
} else if (request.getScheme().equals("https") && port == 443) {
@romannurik
romannurik / DashboardLayout.java
Created March 23, 2011 05:06
A custom Android layout class that arranges children in a grid-like manner, optimizing for even horizontal and vertical whitespace.
/*
* ATTENTION:
*
* This layout is now maintained in the `iosched' code.google.com project:
*
* http://code.google.com/p/iosched/source/browse/android/src/com/google/android/apps/iosched/ui/widget/DashboardLayout.java
*
*/
/*
@spara
spara / postgres-ubuntu-ec2-install.sh
Created March 23, 2011 02:54
Install script for PostgreSQL/PostGIS on Canonical Ubuntu EC2 AMI with tables EBS RAID 10
#!/usr/bin/env bash
################################################################
#
# Amazon EC2 PostGIS 1.5 on RAID10,f2 EBS Array Build Script
#
# Complete Rip off of:
# http://github.com/tokumine/ebs_raid_postgis/blob/master/build.sh
# http://alestic.com/2009/06/ec2-ebs-raid
# http://biodivertido.blogspot.com/2009/10/install-postgresql-84-and-postgis-140.html
#
@petedoyle
petedoyle / Make easier to read
Created December 30, 2010 23:57
BBB url creation
// CONFIG:
def apiBaseUrl = "http://conf.cotni.org/bigbluebutton/api" // no trailing '/' please
def salt = "26f31c52-6d4f-4562-b3c7-fd7857d191ac"
def phoneNumber = "360-536-4392" // the number to join the conference via phone
def meetingParams = [
name: 71000,
meetingID: 71000,
attendeePW: 7777,
moderatorPW: 8888,
@kashif
kashif / mk_postgis_template.sh
Created November 7, 2010 16:16
make a postgis template
# Set postgis-1.5 path.
$ POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib/postgis-1.5
# Creating the template spatial database
$ createdb -E UTF8 -T template0 template_postgis
# and add PLPGSQL language support.
$ createlang -d template_postgis plpgsql
# Loading the PostGIS SQL routines.
$ psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql
%html
%head
%title Welcome to Grails
%meta(name="layout" content="main")
:css
#nav {
margin-top:20px;
margin-left:30px;
width:228px;
float:left;
@kneath
kneath / _README.md
Created November 18, 2009 21:42 — forked from defunkt/bundle.rake
Intelligent asset bundling for Rails (GitHub's asset bundling)

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js