Skip to content

Instantly share code, notes, and snippets.

View RuyiLi's full-sized avatar
🐶
if id ex mem wb

Roy Li RuyiLi

🐶
if id ex mem wb
View GitHub Profile
@defnull
defnull / gist:1224387
Created September 17, 2011 21:22
Deploy a Bottle app on Heroku
mkdir heroku
cd heroku/
virtualenv --no-site-packages env
source env/bin/activate
pip install bottle gevent
pip freeze > requirements.txt
cat >app.py <<EOF
import bottle
import os
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@cjaoude
cjaoude / gist:fd9910626629b53c4d25
Last active May 1, 2024 08:22
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com
@mdang
mdang / RAILS_CHEATSHEET.md
Last active April 13, 2024 15:36
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@CMCDragonkai
CMCDragonkai / history_data_structures.md
Last active March 31, 2024 00:39
History Data Structures

History Data Structures

For stateful applications, there are 5 different ways of managing the history of state:

  • No History - Living in the moment. - Examples: Any stateful application that doesn't discards all previous states upon mutation.
  • Ad Hoc Snapshotting - Allows restoration to manually saved snapshots. - Examples: Memento Pattern.
  • Singleton - Only remembers the previous snapshot, where undoing the undo is just another undo. - Examples: Xerox PARC Bravo.
  • 1 Stack - Allows linear undo. - Examples: AtariWriter.
  • 2 Stack - Allows linear undo and redo. - Examples: Browser History, Microsoft Word, Adobe Photoshop.
@lopezjurip
lopezjurip / Caddyfile
Last active April 27, 2024 23:19
Fix Too Many Redirect error using Caddy + Cloudflare
www.mysite.com, mysite.com {
proxy / webapp:3000 {
proxy_header Host {host}
proxy_header X-Real-IP {remote}
proxy_header X-Forwarded-Proto {scheme}
}
gzip
tls your@email.com
}
@jithatsonei
jithatsonei / pomfforretards.md
Last active June 12, 2023 07:22
Pomf For Retards

SETTING UP POMF FOR RETARDS

You're probably reading this because you're too dense to google "lamp stack setup" and read the Readme.md in the git repo. The readme sucks ass though, so if that's the reason i don't really blame you. For the sake of simplicity I'm going to be using Apache and Ubuntu 16.04. If you want an Nginx guide, go fuck yourself. Things in code text with gray backgrounds are code you're supposed to enter in your command line.

PREREQUISITES

A LAMP stack (Linux, Apache, MySQL, and PHP)

Node.js/NPM

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 1, 2024 19:56
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@xDimGG
xDimGG / app.js
Created October 15, 2017 19:07
Basic Discord OAuth2 Example
const { get, post } = require('snekfetch');
const express = require('express');
const btoa = require('btoa');
const app = express();
const cfg = {
id: 'get_one',
secret: 'get_one'
};
@peltho
peltho / svelte.md
Last active April 2, 2024 07:43
Svelte cheatsheet