Skip to content

Instantly share code, notes, and snippets.

@nzbr
nzbr / zoomvm.nix
Last active January 29, 2024 00:42
NixOS Configuration for Running Zoom in a VM, where it belongs, because you have to...
# INSTRUCTIONS:
# 1. Follow the installation instructions at
# https://nixos.org/nixos/manual/index.html until
# /mnt/etc/nixos/configuration.nix is edited
# 2. Replace that file with this one:
# -> curl -L -o /mnt/etc/nixos/configuration.nix https://go.nzbr.de/zoomvm
# 3. You will need to edit this configuration if you want a locale other than
# german (i18n and xserver.locale) or not use UEFI (boot.loader)
# 4. Run `nix-env -i git` to install git on the live system (may take some time)
# 5. Run nixos-install
@corngood
corngood / configuration.nix
Created January 23, 2017 00:02
NixOS matrix server using nginx
{ config, pkgs, ... }:
{
imports =
[
/etc/nixos/hardware-configuration.nix
];
nix.buildCores = 0;
@tmichel
tmichel / reprbase.py
Created July 21, 2014 11:22
sqlalchemy generic __repr__
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm.properties import ColumnProperty
class RepresentableBase(object):
def __repr__(self):
prop = filter(lambda p: isinstance(p, ColumnProperty), self.__mapper__.iterate_properties)
keys = [p.key for p in prop]
prop_values = dict(zip(keys, [getattr(self, k) for k in keys]))
@nikita-volkov
nikita-volkov / gist:6977841
Last active July 4, 2022 13:33
Anonymous records. A solution to the problems of record-system.

#Anonymous records. A solution to the problems of record-system.

Please, beware that the proposal that follows has been implemented as a library.

The current record system is notorious for three major flaws:

  1. It does not solve the namespacing problem. I.e., you cannot have two records sharing field names in a single module. E.g., the following won't compile:

data A = A { field :: String }

@AndrewRayCode
AndrewRayCode / gist:3784055
Created September 25, 2012 19:53
jQuery plugin for shift + click to select multiple checkboxes
// Usage: $form.find('input[type="checkbox"]').shiftSelectable();
// replace input[type="checkbox"] with the selector to match your list of checkboxes
$.fn.shiftSelectable = function() {
var lastChecked,
$boxes = this;
$boxes.click(function(evt) {
if(!lastChecked) {
lastChecked = this;
@ocean90
ocean90 / box-shadow.html
Last active April 11, 2024 13:54
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;