Skip to content

Instantly share code, notes, and snippets.

Javier user454322

Block or report user

Report or block user454322

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View channels.go
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 Jan 19, 2018
Store ZonedDateTimeConverter as timestamp using JPA
View ZonedDateTimeConverter.java
/*
* 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 Sep 21, 2016
CockroachDB for macports
View Portfile
# -*- 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
View .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
View .inputrc
set completion-ignore-case on
set editing-mode vi
set keymap vi
View xfce-clock.format.txt
Clock options
Custom format
%b %d日 (%a) %H:%M:%S
View monitor_replication.rb
#!/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'.
View gist:f93f183797dbebebfb65
netcat
user@server$ cat /tmp/oom-heapdump | nc -l 9741
me@local$ nc server.com 9741 > oom-heapdump
@user454322
user454322 / git
Last active Feb 8, 2017
My git commands
View git
Status between branches
git diff --name-status master..branch_name
Merging while ignoring some files
git merge --no-commit --no-ff branch_name
git reset /path/to/ignored
Tags
@user454322
user454322 / openssl_android_v.sh
Created Sep 12, 2014
Find out which OpenSSL version is used in each version of Android
View openssl_android_v.sh
#!/bin/sh
#git clone https://android.googlesource.com/platform/external/openssl
for ANDROID_TAG in $(git ls-remote --tags| colrm 1 48| grep -v "\^{}")
do
git checkout "$ANDROID_TAG"
OPENSSL_V="$(cat openssl.version)"
echo "[$OPENSSL_V] - [$ANDROID_TAG]" >> openssl.versions
done
You can’t perform that action at this time.