Skip to content

Instantly share code, notes, and snippets.

View kirkness's full-sized avatar
😎

Henry kirkness

😎
View GitHub Profile
@tcbyrd
tcbyrd / now.json
Last active December 26, 2018 12:36
Probot on Now.sh v2
{
"version": 2,
"builds": [
{ "src": "probot.js", "use": "@now/node" }
],
"env": {
"GITHUB_TOKEN": "@github-token",
"APP_ID": "@app-id",
"PRIVATE_KEY": "@private-key-base64"
},
@roelvan
roelvan / dev-server.js
Created November 26, 2018 11:48
NOW v2 Local DEV env Node.js
require('dotenv').config();
const http = require('http');
const url = require('url');
// import NOW SETTINGS
const now = require('./now.json');
const PORT = process.env.PORT || 3030;
const routes = now.routes.reduce((map, route) => {
@aweary
aweary / App.js
Last active August 29, 2021 14:06
import React from "react";
import useMutableReducer from "./useMutableReducer";
const reducer = (draft, action, state) => {
switch (action) {
case "increment":
draft.count++;
break;
case "decrement":
draft.count--;
@naesheim
naesheim / buildWhenAffected.sh
Last active November 28, 2022 20:20
CircleCi - only build features that has changed
##################
### config.yml ###
##################
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6
steps:
WITH
-- write the new values
n(ip,visits,clicks) AS (
VALUES ('192.168.1.1',2,12),
('192.168.1.2',6,18),
('192.168.1.3',3,4)
),
-- update existing rows
upsert AS (
UPDATE page_views o
@jfmengels
jfmengels / lodash-fp-documentation.md
Last active February 6, 2024 20:57
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs
@n0ts
n0ts / remote_bash.sh
Created May 1, 2014 06:35
execute bash script from remote site
# http://stackoverflow.com/questions/5735666/execute-bash-script-from-url
bash <(curl -s http://mywebsite.com/myscript.txt)
# http://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl
curl http://foo.com/script.sh | bash -s arg1 arg2
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions