Skip to content

Instantly share code, notes, and snippets.

View dmitry's full-sized avatar
🇪🇪
Water, earth and air.

Dmitry Polushkin dmitry

🇪🇪
Water, earth and air.
View GitHub Profile
@linjunpop
linjunpop / deploy-rails-4-app-with-dokku-on-digital-ocean.md
Last active September 11, 2024 10:21
Deploy Rails 4 app with Dokku on DigitalOcean

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@mait
mait / Dockerfile
Last active December 19, 2015 16:28
# vim: ft=sh
from ubuntu:precise
# change to fast mirror
# run echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
run echo "deb http://ftp.neowiz.com/ubuntu precise main universe" > /etc/apt/sources.list
# reduce output from debconf
env DEBIAN_FRONTEND noninteractive
@cdcarson
cdcarson / gist:5929167
Created July 4, 2013 17:12
List of Terminal shortcuts
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Let’s you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor
@willurd
willurd / web-servers.md
Last active July 10, 2025 21:59
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jpetazzo
jpetazzo / README.md
Last active September 30, 2022 05:36
Share a directory with a docker container

Rectifier

The diode bridge is the simplest rectifier I know.

Rectifier lets you share a directory with a docker container (just like $yourvm shared folders).

You don't have to install anything in your containers, and you only need to install diod in the host. diod is packaged on Ubuntu/Debian distros, and will automatically be apt-get install-ed if needed.

Since it uses diod to make a bridge, I called it rectifier. Yeah, that sucks, so if you have a better name, I'll steal it!

@andreas
andreas / gist:5432990
Created April 22, 2013 07:14
Use [rblineprof](https://github.com/tmm1/rblineprof) for profiling Rails apps
class RBLineProfiler
WALL_TIME_LIMIT = 10e3 # ms
def initialize(app)
@app = app
end
def call(env)
result = nil
profile = lineprof(/./) { result = @app.call(env) }
@emil10001
emil10001 / install_java.sh
Created April 15, 2013 05:49
Installing oracle java on Ubuntu
#!/bin/sh
# http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
@pmeinhardt
pmeinhardt / capybara-cheatsheet.md
Last active December 14, 2015 16:29 — forked from zhengjia/capybara cheat sheet
overview of the capybara dsl

Capybara Cheat Sheet

View the original gist: https://gist.github.com/428105

Navigating

visit "/projects"
visit post_comments_path(post)

Clicking Links and Buttons

@rogerleite
rogerleite / Gemfile
Last active December 14, 2015 14:38
Tail call optimization in Ruby
source 'https://rubygems.org'
gem "method_source", "~> 0.8.1"
@ndarville
ndarville / examples.mdown
Last active December 9, 2019 11:32
“We’ve Been Hacked” Boilerplate Announcement

How Companies Communicated Being Hacked

It’s probably a pretty bad idea to have your site go down, when people are supposed to read the blog post explaining the hack.

Notice how another site reporting the hack received more attention than Twitter’s own announcement. Why was that?