Skip to content

Instantly share code, notes, and snippets.

View user454322's full-sized avatar
💭
I may be slow to respond.

Javier user454322

💭
I may be slow to respond.
View GitHub Profile
@user454322
user454322 / python-profiling.py
Created December 1, 2022 02:08
Python profiling
import cProfile
import time
#...
def set_up(self):
#...
self.pr = cProfile.Profile()
self.pr.enable()
def tear_down(self):

is it interesting for the venue?

is it correct?

is it improving the state-of-the-art?

[TITLE]

0. Pass

#!/usr/bin/env bash
#set -e
#openssl s_client -starttls smtp -showcerts -connect email.example.com:25 -servername email.example.com
#openssl x509 -in /etc/ssl/email.example.com.fullchain.pem -text
readonly LOG_PATH='/var/log/acme-cert-renew.log'
readonly DOMAIN='example.com'
echo '::::::::::::::::::::::' | ts | tee -a "$LOG_PATH"
@user454322
user454322 / channels.go
Last active February 1, 2018 09:22
Go channel
package main
import (
"fmt"
"time"
)
func multiply(arg float32, c chan float32) {
var val = arg * arg
for i := 0; i < 10; i++ {
@user454322
user454322 / ZonedDateTimeConverter.java
Created January 19, 2018 05:41
Store ZonedDateTimeConverter as timestamp using JPA
/*
* Store Java 8 ZonedDateTimeConverter as Timestamp in the database.
* Set `hibernate.jdbc.time_zone = UTC` so the timezone is set to UTC.
*/
package info.modprobe.cwp.data;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import java.time.ZoneId;
@user454322
user454322 / Portfile
Last active September 21, 2016 11:29
CockroachDB for macports
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$
PortSystem 1.0
PortGroup github 1.0
github.setup cockroachdb cockroach beta-20160915
name cockroachdb
categories databases
platforms darwin
@user454322
user454322 / .vimrc
Last active September 5, 2016 07:53
.vimrc
set mouse-=a
"set cc=80
"set paste
set nu
set list
set hlsearch
set ls=2
"set cursorcolumn
set cursorline
hi CursorLine ctermbg=Gray
@user454322
user454322 / .inputrc
Last active February 8, 2016 01:26
.inputrc
set completion-ignore-case on
set editing-mode vi
set keymap vi
Clock options
Custom format
%b %d日 (%a) %H:%M:%S
@user454322
user454322 / monitor_replication.rb
Created November 23, 2015 08:04
CouchDB replication
#!/usr/bin/env ruby
#Start CouchDB replication with
#curl -X POST -d '{"source":"https://user:passwd@src_ip:6984/source_db", "target":"https://user:passwd@dst_ip:6984/dst_db", continuous:true}' -H 'Content-Type: application/json' https://host:6984/_replicator
# This script checks a list of databases that should be replicating and their last replication time.
# If the replication hasn't been updated in an hour, an email is sent to 'email@example.com'
# with the subject 'CouchDB replication problem'.