Skip to content

Instantly share code, notes, and snippets.

View janesmae's full-sized avatar
1.21 gigawatts!

Jaan Jänesmäe janesmae

1.21 gigawatts!
View GitHub Profile
@janesmae
janesmae / gopass-client.py
Created March 7, 2019 17:39 — forked from wakemaster39/gopass-client.py
Ansible Vault Password integration with gopass
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Assuming you have a working gopass installation. I personally use multiple mounts and I store all the passwords under a
# single directory.
#
# Add the following section to your `ansible.cfg`
#
# [vault]
# mount='store-X' # replace `store-x` with your actual store, if using the root set to an empty string
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Jigsaw puzzle</title>
<script type="text/javascript">
function save(filename, data)
{
var blob = new Blob([data], {type: "text/csv"});
@janesmae
janesmae / postgres_queries_and_commands.sql
Created August 23, 2017 14:04 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
SELECT *
FROM tablename
WHERE DATE(timestamp_column)
BETWEEN (DATE_SUB(DATE(NOW()), INTERVAL DAYOFWEEK(NOW())+5 DAY))
AND (DATE_SUB(DATE(NOW()), INTERVAL DAYOFWEEK(NOW())-1 DAY))

Keybase proof

I hereby claim:

  • I am janesmae on github.
  • I am janesmae (https://keybase.io/janesmae) on keybase.
  • I have a public key whose fingerprint is 1FB9 6D1F 8020 61CD 868E D778 0A56 8007 6D55 63BC

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<title>D3.js Test 0001</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<style>
body {
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@janesmae
janesmae / work-in-progress.js
Created February 28, 2013 00:05
Well, if you're developing a webpage or web app and someone higher ranking than you needs constantly visual updates, then this little script is for you!
/* http://james.padolsey.com/javascript/shuffling-the-dom/ */
(function($){
$.fn.shuffle = function() {
var allElems = this.get(),
getRandom = function(max) {
return Math.floor(Math.random() * max);
},
shuffled = $.map(allElems, function(){