Skip to content

Instantly share code, notes, and snippets.

@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>
@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 / tree-style-tab.css
Created September 11, 2018 22:50
Firefox Tree Style Tab Customization
/* tab height */
:root {
--tab-height: 22px !important;
background-color: #000000;
}
.tab {
height: var(--tab-height) !important;
background: #4d4e51;
color: #bbc2cf;
@pvik
pvik / userChrome.css
Created September 11, 2018 22:52
Firefox Customization - userChrome.css
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* to hide the native tabs */
#TabsToolbar {
visibility: collapse;
}
/* to hide the sidebar header */
#sidebar-header {
visibility: collapse;
@pvik
pvik / userContent.css
Created September 11, 2018 22:53
Firefox Customization - userContent.css
@-moz-document regexp("moz-extension://.+/resources/group-tab.html.*") {
:root {
background: #bbc2cf;
}
}
@pvik
pvik / home.html
Last active September 12, 2018 12:37
custom homepage
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="favicon.png" />
<title>elric's home</title>
<!--link rel="stylesheet" href="style.css"-->
<style media="screen" type="text/css">
html {
font-family: Hack;
font-size: 16px;
@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
#!/usr/bin/python
print("hello from python")
(set-env!
:source-paths #{"src/scss" "src/clj" "src/cljs" "src/cljc"}
:resource-paths #{"html" "resources"}
:dependencies '[[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.520"]
;; server
[compojure "1.6.1"]
[ring/ring-core "1.7.1"]
[ring/ring-jetty-adapter "1.7.1"]
let wire1 = ["R98" ; "U47" ; "R26" ; "D63" ; "R33" ; "U87" ; "L62" ; "D20" ; "R33" ; "U53" ; "R51"]
let wire2 = ["U98" ; "R91" ; "D20" ; "R16" ; "D67" ; "R40" ; "U7" ; "R15" ; "U6" ; "R7"]
type point = {
x : float ;
y : float
}
type line = {
p1 : point ;