Skip to content

Instantly share code, notes, and snippets.

View rhaseven7h's full-sized avatar
🙊

Gabriel Medina rhaseven7h

🙊
View GitHub Profile
@rhaseven7h
rhaseven7h / Dockerfile
Created December 9, 2017 08:10
Dockerfile for Ruby + MySQL Client + Bundler & SQLite3 Gems
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y \
build-essential \
zlib1g-dev \
libreadline-dev \
libssl-dev \
libffi-dev \
libncurses-dev \
@rhaseven7h
rhaseven7h / Main.java
Created June 10, 2016 20:59
Get single character in java console (terminal, blocking call)
import java.io.Console;
import java.io.IOException;
import java.io.Reader;
import java.lang.Runtime;
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
System.out.println("Press the \"z\" key to exit!");
String[] cmd = {"/bin/sh", "-c", "stty raw </dev/tty"};
@rhaseven7h
rhaseven7h / centos-install-syntax-highlighting-in-less.sh
Created May 7, 2020 08:17 — forked from textarcana/centos-install-syntax-highlighting-in-less.sh
2020 update: just use bat(1) instead!!!! bat has git integration and also can show invisible characters! OLD STUFF: How to enable syntax-highlighting in less. Use `less -N` (or type -N while in less) to enable line numbers. Based on the procedure described in http://superuser.com/questions/71588
# Enable syntax-highlighting in less.
# Last tested on CentOS 6.3.
#
# First, add these two lines to ~/.bashrc
# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
# export LESS=" -R "
sudo yum -y install boost boost-devel ctags
wget http://springdale.math.ias.edu/data/puias/unsupported/6/x86_64/source-highlight-3.1.6-3.puias6.x86_64.rpm
@rhaseven7h
rhaseven7h / chrome-devtools.md
Created April 30, 2020 19:19 — forked from vbsessa/chrome-devtools.md
How to customize Chrome devtools fonts
  1. Enable #enable-devtools-experiments flag in chrome://flags section.

  2. Open Chorme Devtools and check Settings > Experiments > Allow custom UI themes.

  3. Create the following four files in a dedicated folder.

    3.1. devtools.html

    <html>
    <head></head>
    <body><script src="devtools.js"></script></body>
@rhaseven7h
rhaseven7h / README.md
Created July 28, 2016 06:15
HackerRank.com - Functional Programming - Haskell - Super Digit

Super Digit

We define super digit of an integer x using the following rules:

  • If x has only 1 digit, then its super digit is x.
  • Otherwise, the super digit of x is equal to the super digit of the digit-sum of x. Here, digit-sum of a number is defined as the sum of its digits.

For example, super digit of 9875 will be calculated as:

@rhaseven7h
rhaseven7h / main.go
Created July 3, 2019 02:08
Sentry Raven Go (Golang) Usage, along with custom Type and Value (Exception Title and Message)
package main
import (
"fmt"
"os"
"time"
"github.com/brianvoe/gofakeit"
"github.com/getsentry/raven-go"
"github.com/pkg/errors"
@rhaseven7h
rhaseven7h / README.md
Created July 1, 2019 03:47 — forked from denji/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@rhaseven7h
rhaseven7h / get-certificate.sh
Last active June 12, 2019 20:52
Let's Encrypt - Ubuntu 18.04 - CertBot Wildcard Certificate
#!/bin/sh
certbot certonly \
--manual \
-d '*.yourdomain.com' \
-d yourdomain.com \
--agree-tos \
--no-bootstrap \
--manual-public-ip-logging-ok \
--preferred-challenges dns-01 \
@rhaseven7h
rhaseven7h / .tmux.conf
Created May 27, 2019 04:30
Sample Tmux Config
unbind-key C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split commands
unbind-key '%'
unbind-key '"'
bind-key '/' split-window -h
bind-key '-' split-window -v
@rhaseven7h
rhaseven7h / supervisord.conf
Created April 5, 2019 03:35 — forked from elithrar/supervisord.conf
Example supervisord.conf for a Go application #golang
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0770
chown=root:supervisor
[supervisord]
pidfile=/var/run/supervisord.pid
nodaemon=false
logfile=/var/log/supervisord/supervisord.log
loglevel=error