Skip to content

Instantly share code, notes, and snippets.

View sydcanem's full-sized avatar
🏠
Working from home

James Santos sydcanem

🏠
Working from home
View GitHub Profile
# 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 / git-install.sh
Last active September 22, 2015 06:24
Git install from source on Centos7
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
@sydcanem
sydcanem / fix-homebrew-npm.md
Created November 9, 2015 14:25 — 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

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 / consul.service
Created December 18, 2015 07:35 — forked from yunano/consul.service
/etc/systemd/system/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

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 / main.go
Created January 7, 2018 22:03 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@sydcanem
sydcanem / launch.json
Created February 23, 2018 18:58
VSCode Launch config for React SSR
{
// 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 / README.md
Last active September 6, 2020 07:31
Express ES6 Boilerplate

Express Boilerplate in ES6

Because it's hard to memorize boilerplates...

@sydcanem
sydcanem / timer.js
Created September 6, 2020 07:11
Promise Timer
function timeout(ms, action) {
const timer = new Promise((resolve, reject) => {
const id = setTimeout(() => {
clearTimeout(id);
reject(`Timed out in ${ms}ms.`);
}, ms);
});
return Promise.race([timer, action]);
}
[
{
"id": 1,
"name": "Table",
"items": [
{ "id": 3, "name": "Bar Table" },
{ "id": 4, "name": "Dining" },
{ "id": 5, "name": "Coffee Table" }
]
},