Skip to content

Instantly share code, notes, and snippets.

@pvik
pvik / color-doom.h
Created September 11, 2018 22:49
Doom Theme Colors for st (suckless terminal)
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] =
{
[0] = "#1c1f24", // black
[1] = "#ff6c6b", // dark red
[2] = "#98be65", // dark green
[3] = "#DA8548", // dark orange
[4] = "#51afef", // dark blue
@pvik
pvik / smartparens-cheatsheet.md
Last active March 17, 2024 03:29
A Cheatsheet for Emacs Smarparens example configuration

An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.

Traversal

C-M-f sp-forward-sexp
C-M-b sp-backward-sexp
@pvik
pvik / hibernate-on-low-battery.sh
Last active September 14, 2018 21:21
Hibernate on Low Battery, when acpi does not report proper battery status
#!/bin/sh
# Battery threshold below which, script will hibernate if discharging
batt_threshold=20
# temporary file to store the previous battery charge value, to determine if battery is being discharged
batt_charge_file="/tmp/batt_charge"
# read in batt charge from acpi
echo "`acpi -b`, `cat /tmp/batt_charge`%" | awk -F'[:,%]' '{print $2, $3, $5, ($5 - $3), ($3-$5)<0?"discharging":"powered"}' | {
read -r acpi_status capacity old_capacity capacity_diff status
@pvik
pvik / gist:56c3c3a3ea655bee8aae
Created December 27, 2015 23:02
Plotting a CSV file
gnuplot> set datafile separator ","
gnuplot> plot 'calls.csv' using 2:xticlabels(1) with lines
@pvik
pvik / adding ms sqlserver jar to maven
Last active August 29, 2015 14:28
sqlserver_mvn.md
taken from [here]{http://claude.betancourt.us/add-microsoft-sql-jdbc-driver-to-maven/}
```
mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0
```
POM:
```
<dependency>
<groupId>com.microsoft.sqlserver</groupId>