Skip to content

Instantly share code, notes, and snippets.

View wpcarro's full-sized avatar

William Carroll wpcarro

  • Hadrian
  • internet
View GitHub Profile
@tazjin
tazjin / knotty.md
Last active September 7, 2022 15:36
Knotty - a featureless IRC bot

knotty

(knotty = Nix + bot + y, duh!)


Knotty is an IRC bot with functionality that is defined by its users. It uses the [Nix][] package manager's [language][nix-1p] for all logic.

@tazjin
tazjin / yants.md
Last active June 15, 2023 22:32
Yet Another Nix Type System (aka YANTS)

yants

Note: Yants now has its own repository.


This is a tiny type-checker for data in Nix, written in Nix.

Features:

@domenkozar
domenkozar / kiosk-chromium.nix
Last active January 24, 2024 14:05
Boot NixOS into chromium kiosk (tested on NixOS 14.04)
services.xserver = {
enable = true;
monitorSection = ''
Option "NODPMS"
'';
serverLayoutSection = ''
Option "BlankTime" "0"
Option "DPMS" "false"
'';
displayManager.auto.user = "guest";
@edef1c
edef1c / default.nix
Last active April 20, 2022 06:32
DNS-over-HTTPS module for NixOS
{ pkgs, ... }:
let
doh-proxy = pkgs.callPackage ./doh-proxy.nix {};
in {
systemd.sockets.doh-stub = {
wantedBy = [ "sockets.target" ];
socketConfig.Service = "doh-stub.service";
socketConfig.ListenDatagram = "[::1]:53";
};
systemd.services.doh-stub = {
@TravelingTechGuy
TravelingTechGuy / get_history.sh
Created May 9, 2016 14:10
Get your Chrome history as a CSV file
#!/bin/bash
# Locate the history file in your profile, and copy it to the same folder as this script.
# On Mac: ~/Library/Application\ Support/Google/Chrome/Default/History
# On Windows: C:\Users\YOUR USER NAME\AppData\Local\Google\Chrome\User Data\Default\History
sqlite3 History <<!
.headers on
.mode csv
.output out.csv
@gaearon
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@lily-mara
lily-mara / evil-custom-objects.el
Last active September 17, 2019 09:42
easily create simple evil-mode text objects
; courtesy of Gordon Gustafson on StackOverflow
; originally posted 2014-03-15
; http://stackoverflow.com/questions/18102004/emacs-evil-mode-how-to-create-a-new-text-object-to-select-words-with-any-non-sp
(defmacro define-and-bind-text-object (key start-regex end-regex)
(let ((inner-name (make-symbol "inner-name"))
(outer-name (make-symbol "outer-name")))
`(progn
(evil-define-text-object ,inner-name (count &optional beg end type)
(evil-regexp-range count beg end type ,start-regex ,end-regex t))
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@jasdeepkhalsa
jasdeepkhalsa / longPolling.js
Last active April 17, 2024 10:59
Simple Long Polling Example with JavaScript and jQuery by Tian Davis (@tiandavis) from Techoctave.com (http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery)
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast)
(function poll(){
$.ajax({ url: "server", success: function(data){
//Update your dashboard gauge
salesGauge.setValue(data.value);
}, dataType: "json", complete: poll, timeout: 30000 });
})();