Skip to content

Instantly share code, notes, and snippets.

View NSLog0's full-sized avatar
🦋

NSLog0 NSLog0

🦋
View GitHub Profile
@bryanbraun
bryanbraun / .gitlab-ci.yml
Created July 6, 2017 15:15
Example Gitlab CI Config for a Rails + Nginx application using Docker Compose
# See how variables work, and a list of predefined ones:
# - https://docs.gitlab.com/ce/ci/variables/
variables:
RAILS_IMAGE: registry.gitlab.com/bryanbraun/gridmaster.io/railsapp:$CI_COMMIT_SHA
NGINX_IMAGE: registry.gitlab.com/bryanbraun/gridmaster.io/nginx:$CI_COMMIT_SHA
DEPLOY_TAG: $CI_COMMIT_SHA
cache:
paths:
- vendor/ruby
@madcoda
madcoda / App.js
Created May 28, 2017 04:24
React-router v4 multi layout
import React, { Component } from 'react'
import { BrowserRouter as Router, Route, Link, Match, Redirect, Switch } from 'react-router-dom'
import OverviewPage from './page/OverviewPage'
import AccountPage from './page/AccountPage'
/*
Layouts, inline define here for demo purpose
you may want to define in another file instead
*/
@straker
straker / README.md
Last active April 30, 2024 05:32
Basic Snake HTML and JavaScript Game

Basic Snake HTML and JavaScript Game

Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Score
  • When the snake eats an apple, the score should increase by one. Use context.fillText() to display the score to the screen
@vishwanath79
vishwanath79 / MacOS_Install_OpenCV.py
Last active May 9, 2019 17:35
Install OpenCV on Mac OS Sierra on Python 3.5
# 1. Download and install the latest Anaconda distribution from https://www.continuum.io/downloads#macos
# 2. Create a new Python environment. Make sure you choose python 3.5 as your python version for the virtual environment:
conda create -n myenv python=3.5
# 3. Activate the new environment using:
source activate myenv

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@bsodmike
bsodmike / ATECC508A.md
Created July 10, 2016 21:49
IoT Security with the Atmel ATECC508A

IoT Security with the Atmel ATECC508A

Get Public ECC Key
Key Number [0-15]
Public Key 15
PubKey:26712508A3544575F38526FA3D6AAAF920728A3ABDF2421841243F1961222944AF116DDFB4AF797EA70FCD09C9FEBC490793C271165410FAF3672BE5FD8D1B5D

Hash Data
Enter Message to hash: Thing Innovations Crypto
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@rwarbelow
rwarbelow / running_app_in_production_locally.markdown
Created November 11, 2015 18:26
How to Run a Rails App in Production Locally
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

@johnthillaye
johnthillaye / mean_aws_deployment_process.MD
Last active October 28, 2022 18:03
MEAN.JS Full Stack Deployment Process to AWS EC2

MEAN.JS Full Stack Deployment Process to AWS EC2

Deploy AWS EC2 Instance

###Install & configure AWS CLI tools

$ sudo pip install awscli
$ aws configure