Skip to content

Instantly share code, notes, and snippets.

View cdanielsen's full-sized avatar

Christian Danielsen cdanielsen

View GitHub Profile
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active July 24, 2024 10:54
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@m-x-k
m-x-k / StepsToSetupArtifactoryWithNpm
Last active December 3, 2022 04:51
Setting up JFrog artifactory for NPM
docker pull docker.bintray.io/jfrog/artifactory-oss:latest
docker run --name artifactory -d -p 8081:8081 docker.bintray.io/jfrog/artifactory-oss
# In browser open http://localhost:8081 and follow basic steps
# Add new remote repository: http://localhost:8081/artifactory/webapp/#/admin/repositories/remote
# URL: https://registry.npmjs.org
# RepositoryLayout: NPM default
# Add new virtual repository of type "Generic" using remote repository above
@boneskull
boneskull / README.md
Last active April 10, 2024 12:47
example of how to debug mocha v4 if hanging

Here's an example of how to debug Mocha v4 if it hangs.

Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).

If you run your test, you'll notice it hangs:

$ mocha test.js
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
@chantastic
chantastic / on-jsx.markdown
Last active May 30, 2024 13:11
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

# Simple PowerShell script to load-test / test REST api with headers and cookies.
# Harald S. Fianbakken
$headers = @{
"Accept"= "application/zip";
"Accept-Encoding"= "gzip,deflate,sdch";
"My-Token-ID" = "This_is_a_test";
};
function Create-Cookie($name, $value, $domain, $path="/"){
@andrew-markham
andrew-markham / Gemfile
Created January 9, 2012 06:48 — forked from RSpace/Gemfile
Running Capybara and RSpec without Rails
source 'http://rubygems.org'
gem 'rspec'
gem 'capybara', :git => 'https://github.com/jnicklas/capybara.git'
gem 'launchy'
gem 'ruby-debug19'