Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

James Santos sydcanem

🏠
Working from home
View GitHub Profile
View List.js
import React from "react";
import Checkbox from "./Checkbox";
import { status } from "./constants";
export default function List(props) {
const { items } = props;
return (
<ul>
{items.map((item) => {
View data.json
[
{
"id": 1,
"name": "Table",
"items": [
{ "id": 3, "name": "Bar Table" },
{ "id": 4, "name": "Dining" },
{ "id": 5, "name": "Coffee Table" }
]
},
View timer.js
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]);
}
@sydcanem
sydcanem / README.md
Last active Sep 6, 2020
Express ES6 Boilerplate
View README.md

Express Boilerplate in ES6

Because it's hard to memorize boilerplates...

@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