Skip to content

Instantly share code, notes, and snippets.

View YacheLee's full-sized avatar

Ya-Che Li YacheLee

  • Doorstead
  • Taiwan
View GitHub Profile
@LauraBeatris
LauraBeatris / jest_config.json
Last active March 10, 2022 02:25
Jest Configuration with Root Import
{
"jest": {
"testMatch": [
"**/__tests__/**/*.test.js"
],
"moduleNameMapper": {
"^~/(.*)": "<rootDir>/src/$1"
},
"setupFilesAfterEnv": [
"@testing-library/react/cleanup-after-each",
const el = document.querySelector(".item");
let isResizing = false;
el.addEventListener("mousedown", mousedown);
function mousedown(e) {
window.addEventListener("mousemove", mousemove);
window.addEventListener("mouseup", mouseup);
@ryansimms
ryansimms / circleci-2.0-eb-deployment.md
Last active February 22, 2024 04:55
Deploying to Elastic Beanstalk via CircleCi 2.0

Deploying to Elastic Beanstalk via CircleCi 2.0

I got to here after spending hours trying to deploy to an Elastic Beanstalk instance via CircleCi 2.0 so I thought I'd write up what worked for me to hopefully help others. Shout out to RobertoSchneiders who's steps for getting it to work with CircleCi 1.0 were my starting point.

For the record, I'm not the most server-savvy of developers so there may be a better way of doing this.

Setup a user on AWS IAM to use for deployments

@rkaramandi
rkaramandi / nginx-and-certbot-config.md
Last active June 25, 2024 13:23
Running NGINX and CertBot Containers on the Same Host

Running NGINX and CertBot Containers on the Same Host

The Problem

A lot of people run into the problem of running Let's Encrypt's CertBot Tool and an NGINX on the same container host. A big part of this has to do with CertBot needing either port 80 or 443 open for the tool to work as intended. This tends to conflict with NGINX as most people usually use port 80 (HTTP) or 443 (HTTPS) for their reverse proxy. Section 1 outlines how to configure NGINX to get this to work, and Section 2 is the Docker command to run CertBot.

1. NGINX Configuration

I use Docker Compose (docker-compose) for my NGINX server. My docker-compose.yml file looks something like this:

@owainlewis
owainlewis / Operations.md
Last active December 8, 2020 06:53
Install Spinnaker on Ubuntu 16.04

Operations

Upgrade Spinnaker to latest

sudo apt-get upgrade -y spinnaker

Check version of Spinnaker installed

@otiai10
otiai10 / golang_jwt_example.go
Last active May 25, 2021 15:47
Golang JWT Example (2017/Oct/26)
package main
import (
"log"
jwt "github.com/dgrijalva/jwt-go"
)
type User struct {
Name string `json:"name"`
@btholt
btholt / ClientApp.jsx
Last active April 26, 2018 16:24
react-router server-side rendering
const React = require('react')
const Landing = require('./Landing')
const Search = require('./Search')
const Layout = require('./Layout')
const Details = require('./Details')
const ReactRouter = require('react-router')
const data = require('../public/data')
const { Router, Route, hashHistory, IndexRoute } = ReactRouter
const Store = require('./Store')
const { store } = Store
@marcelometal
marcelometal / thumbor.service
Created July 27, 2015 22:25
Thumbor systemd
# File: /lib/systemd/system/thumbor.service
[Unit]
Description=Photo thumbnail service
[Service]
Type=simple
ExecStart=/usr/bin/thumbor -c /etc/thumbor.conf
[Install]

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@touhonoob
touhonoob / gs.nginx.conf
Created June 6, 2015 13:35
Nginx as Google Cloud Storage Cache
# Cache 10GB for 1 Month
proxy_cache_path /var/cache/nginx keys_zone=GS:10m inactive=720h max_size=10240m;
upstream gs {
server 'storage.googleapis.com:80';
keepalive 100;
}
server {
set $my_domain "yourdomain.com";