Skip to content

Instantly share code, notes, and snippets.

@thefish
thefish / gist:62982c2f836916fce3bb9cc6ff922d84
Created February 23, 2022 23:48 — forked from equaliser/gist:5194456
Arduino MCP4922 SPI DAC demo code
/*
MCP4922 test
Steve Woodward, 2010
most code borrowed from
http://mrbook.org/blog/2008/11/22/controlling-a-gakken-sx-150-synth-with-arduino/
connections
====================================================
+5v > 4922 pin 1
package main
import (
"bufio"
"fmt"
"github.com/jessevdk/go-flags"
"github.com/rs/zerolog/log"
"os"
"strconv"
"strings"
@thefish
thefish / mocp_display_song.sh
Last active January 15, 2019 15:16
mocp on ubuntu display song by std notify script
#! /bin/bash
set -e
moc-gather-info ()
{
local key val
while read -r key val ; do
eval "Moc${key%:}='${val//\'}'"
done < <( mocp --info )
}
@thefish
thefish / pg_on_ram.sh
Created July 3, 2018 12:32 — forked from guewen/pg_on_ram.sh
Create a PostgreSQL cluster in a ramfs and start the server on this cluster.
#!/bin/bash
PORT=6432
# Create a ramfs
if [ -f /tmp/pg_on_ram ]
then
echo "/tmp/pg_on_ram already exists"
exit 1
fi
@thefish
thefish / dnsbl.sh
Created November 12, 2017 09:13 — forked from agarzon/dnsbl.sh
DNS Black List - Linux shell script (improved from: http://www.daemonforums.org/showthread.php?t=302)
#!/bin/sh
# Check if an IP address is listed on one of the following blacklists
# The format is chosen to make it easy to add or delete
# The shell will strip multiple whitespace
BLISTS="
bl.score.senderscore.com
bl.mailspike.net
bl.spameatingmonkey.net
b.barracudacentral.org
@thefish
thefish / codeStyleSettings.xml
Created October 17, 2017 16:15 — forked from alanhartless/codeStyleSettings.xml
PhpStorm Symfony Code Style
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<option name="RIGHT_MARGIN" value="150" />
<PHPCodeStyleSettings>
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
# -*- coding: utf-8 -*-
# Simple example which uses a pool of workers to carry out some tasks.
#
# Notice that the results will probably not come out of the output
# queue in the same in the same order as the corresponding tasks were
# put on the input queue. If it is important to get the results back
# in the original order then consider using `Pool.map()` or
# `Pool.imap()` (which will save on the amount of code needed anyway).
@thefish
thefish / klavaorg-telegram-links.md
Last active January 10, 2018 14:42
Klava.org - Полезные ссылки для Телеграм-чата
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Monad.IO.Class (liftIO)
import Network.HTTP.Types
import Network.Wai.Middleware.RequestLogger
import Network.Wai.Middleware.Static
@thefish
thefish / monaco-ubuntu-antialias.sh
Last active August 29, 2015 13:58
Monaco font on Ubuntu with antialiasing
#!/bin/bash
cd /usr/share/fonts/truetype/
sudo mkdir ttf-monaco
cd ttf-monaco/
sudo wget http://www.gringod.com/wp-upload/software/Fonts/Monaco_Linux.ttf
sudo mkfontdir