Skip to content

Instantly share code, notes, and snippets.

View faun's full-sized avatar
🌵

Faun faun

🌵
View GitHub Profile
@rf-
rf- / nvim-client
Last active December 9, 2024 06:07
#!/usr/bin/env python
import pynvim, os, re, sys, time
# Get a list of buffers that haven't been deleted. `nvim.buffers` includes
# buffers that have had `:bdelete` called on them and aren't in the buffer
# list, so we have to filter those out.
def get_listed_buffers(nvim):
return set(buf.number for buf in nvim.buffers \
if nvim.eval('buflisted(%d)' % buf.number))
@flaschbier
flaschbier / mkpycurl.py
Last active April 18, 2019 21:50
Automates compiling a python-pycurl version with openssl instead of GnuTLS for Ubuntu and Raspbian following the recipe in Gist https://gist.github.com/aerickson/f15133a7e56b2d7f27e3. See this answer http://askubuntu.com/a/666868/184228 on Ask Ubuntu for details.
#!/bin/bash
#
# How to rebuild PycURL against OpenSSL on Ubuntu
# (tested for 14.04.2 now)
#
# This script implements the great Gist by aerickson:
# https://gist.github.com/aerickson/f15133a7e56b2d7f27e3
# feel free to use it anyway you like.
# Credits go to Andrew anyway :)
@nateberkopec
nateberkopec / 0.result.md
Last active January 18, 2024 11:20 — forked from tomfuertes/0.result.md
De-'Async Inject'ing Universal Analytics

De-'Async Inject' Universal Analytics

This gist applies the theory from Ilya Grigorik's Script-injected "async scripts" considered harmful on the default Universal Analytics snippet. TLDR place this above the CSS in the <head> of your document

<!-- Google Analytics Part 1: Creates window.ga, sets account, and queues pageview-->
<script>
  !function(n,t){n.GoogleAnalyticsObject=t,n[t]=n[t]||function(){(n[t].q=n[t].q||[]).push(arguments)},n[t].l=1*new Date}(window,"ga");
  ga('create', 'UA-XXXX-Y', 'auto'); // REPLACE UA-XXXX-Y w/ YOUR ACCOUNT
 ga('send', 'pageview');
@sage-oli-wood
sage-oli-wood / gist:70e0931f037ea0aac132
Created November 5, 2015 17:38
F.Ugly way to push TCP network stats into DataDog. Can be run from a crontab entry
#!/bin/bash -eux
// set $DATADOGKEY to your API key
DATE=$(date +%s)
HOSTNAME=`hostname`
cat /proc/net/sockstat | grep TCP | cut -d":" -f2 |sed 's/^ //g' | awk '{print $1, $2"\n"$3, $4"\n"$5,$6"\n"$7,$8"\n"$9,$10}' > /tmp/stats.tmp
while read LINE; do
METRIC=$(echo $LINE | cut -d" " -f1)
VALUE=$(echo $LINE | cut -d" " -f2)
curl -X POST -H "Content-type: application/json" \
@vnys
vnys / exiftool.md
Last active October 14, 2016 05:51
exiftool

Navngi filer med samme konvensjon som brukes av DropBox i Camera Upload.

cd <photo-directory>
exiftool "-FileName<CreateDate" -d "%Y-%m-%d %H.%M.%S%%-c.%%le" .
@winebarrel
winebarrel / pg_show_grants.sql
Last active July 16, 2025 19:02
show grants for PostgreSQL
select
pg_user.usename,
t1.nspname,
t1.relname,
relacl.privilege_type,
relacl.is_grantable
from (
select
pg_namespace.nspname,
pg_class.relname,
@adamzaninovich
adamzaninovich / neovim-setup.md
Last active January 18, 2025 07:36
How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

Example

Installing neovim

brew install neovim/neovim/neovim
@frnhr
frnhr / .bash_profile
Created March 17, 2016 22:39
Show current pyenv python version in bash prompt, and also color virtual envs differently
####
#### pyenv-virtualenv bash prompt customization
####
# pyenv
eval "$(pyenv init -)"
# pyenv-virtualenv:
@motleytech
motleytech / casper.md
Created June 21, 2016 01:00
Deal with casper

Unofficial Guide to JAMF Casper

This page documents the external/internal behavior of Casper.

Files

Casper installed itself into the following directories:

  • /Library/Application Support/JAMF
    • ManagementFrameworkScripts - a set of scripts that runs on certain events
      • StartupScript.sh - Activated when jamf is started
      • loginhook.sh - Activated when user login
  • logouthook.sh - Activated when user logout
Large Object Motions:
(
)
{
}
[[
[]
][
]]
[m