Skip to content

Instantly share code, notes, and snippets.

View rmariano's full-sized avatar
😀
Technically fearless; Exemplary practitioner.

Mariano Anaya rmariano

😀
Technically fearless; Exemplary practitioner.
View GitHub Profile
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active April 26, 2024 02:03
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@divan
divan / main.go
Created March 21, 2017 15:01
Golang database/sql+http example (postgres)
// Run PostgreSQL server:
// docker run -e POSTGRES_PASSWORD="" -p 5432:5432 postgres
// Monitor running processes:
// watch -n 1 'echo "select pid,query_start,state,query from pg_stat_activity;" | psql -h localhost -U postgres
//
// For all handlers, call to db takes 5 seconds,
//
// Three endpoints:
// - "/" - take 5 seconds
// - "/ctx" - take 1 seconds, due to 1 second cancellation policy
@slaveofcode
slaveofcode / gist:6c143e9759d692b62821a1c32f6692b0
Created February 18, 2017 18:45 — forked from yograterol/gist:99c8e123afecc828cb8c
"gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory" workaround
"gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory" CentOS's and Fedora +22 workaround
Install `redhat-rpm-config`
$ sudo dnf install redhat-rpm-config
@arjones
arjones / notify-slack.sh
Last active September 9, 2023 22:20
Notify Slack - Send notifications to a Slack Channel - http://arjon.es/2016/09/15/be-notified-on-slack-when-a-long-process-finishes/
# Notify Slack - Send notifications to a Slack Channel
# Copyright (C) 2016 Gustavo Arjones (@arjones)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# Full blog post here: http://arjon.es/2016/09/15/be-notified-on-slack-when-a-long-process-finishes/
#
#!/usr/bin/env python
"""
no more embarrasing "removed pdb, sorry" commits
install
-------
save it as .git/hooks/pre-commit giving +x permission
"""
@fisadev
fisadev / .offlineimaprc
Last active August 29, 2015 14:27
Backup automático de gmail
[general]
accounts = GMail
maxsyncaccounts = 3
[Account GMail]
localrepository = Local
remoterepository = Remote
autorefresh = 5
quick = 5
@jborg
jborg / gist:d50975951580c53322a0
Created February 25, 2015 12:52
xmlsec1-config: Add missing XMLSEC_NO_SIZE_T
--- /usr/bin/xmlsec1-config.orig 2015-02-25 13:47:13.384286257 +0100
+++ /usr/bin/xmlsec1-config 2015-02-25 13:46:54.849285579 +0100
@@ -199,7 +199,7 @@
#
# Assemble all the settings together
#
-the_flags="$the_flags -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_DL_LIBLTDL=1 -I/usr/include/xmlsec1 $the_xml_flags $the_xslt_flags $the_crypto_flags"
+the_flags="$the_flags -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_DL_LIBLTDL=1 -DXMLSEC_NO_SIZE_T -I/usr/include/xmlsec1 $the_xml_flags $the_xslt_flags $the_crypto_flags"
the_libs="$the_libs -L${package_libdir} -lxmlsec1 -lltdl $the_xmlsec_crypto_lib -lxmlsec1 $the_xml_libs $the_xslt_libs $the_crypto_libs"
with mock.patch("%s.restart_server" % module_under_test, autospec=True) as mock_restart:
restart_servers_in_datacenter(servers, "sfo")
mock_restart.assert_called_once()
# vim: set ft=python :
from __future__ import print_function
import json
import sys
import datetime
from redis import StrictRedis as Redis