Skip to content

Instantly share code, notes, and snippets.

Avatar

James Santos sydcanem

View GitHub Profile
@sydcanem
sydcanem / launch.json
Created Feb 23, 2018
VSCode Launch config for React SSR
View launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Chrome",
@sydcanem
sydcanem / main.go
Created Jan 7, 2018 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
View keybase.md

Keybase proof

I hereby claim:

  • I am sydcanem on github.
  • I am sydcanem (https://keybase.io/sydcanem) on keybase.
  • I have a public key ASDreDHKszuBzoPCDK7GhN8pcHPOiOColl5NSpwJ0Z2qBAo

To claim this, I am signing this object:

@sydcanem
sydcanem / consul.service
Created Dec 18, 2015 — forked from yunano/consul.service
/etc/systemd/system/consul.service
View consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
@sydcanem
sydcanem / fix-homebrew-npm.md
Created Nov 9, 2015 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew
View fix-homebrew-npm.md

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
@sydcanem
sydcanem / git-install.sh
Last active Sep 22, 2015
Git install from source on Centos7
View git-install.sh
sudo yum groupinstall "Development Tools"
sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel curl-devel
wget https://github.com/git/git/archive/v2.5.1.tar.gz -O git.tar.gz
tar -zvf git.tar.gz
cd git-*
make configure
./configure --prefix=/usr/local
sudo make install
View Nginx expires.conf
# Expire rules for static content
# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
# access_log logs/static.log; # I don't usually include a static log
}
# Feed
location ~* \.(?:rss|atom)$ {
@sydcanem
sydcanem / Nginx gzip.conf
Last active Apr 18, 2020
Gzip configuration for Nginx
View Nginx gzip.conf
#Enable Gzip compressed.
gzip on;
# Enable compression both for HTTP/1.0 and HTTP/1.1.
gzip_http_version 1.1;
# Compression level (1-9).
# 5 is a perfect compromise between size and cpu usage, offering about
# 75% reduction for most ascii files (almost identical to level 9).
gzip_comp_level 5;
View 1.README.md

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
View osx-homebrew-setup.md

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2

You can’t perform that action at this time.