Skip to content

Instantly share code, notes, and snippets.

@yurivish
yurivish / venn-diagrams.js
Last active December 26, 2020 03:20
Area-proportional Venn Diagrams
// Since `overlapArea` function is monotonic increasing, we can perform a
// simple bisection search to find the distance that leads to an overlap
// area within epsilon of the desired overlap.
function distanceForOverlapArea(r1, r2, desiredOverlap) {
// Ensure r1 <= r2
if (r1 > r2) {
var temp = r2;
r2 = r1;
r1 = temp;
}
@maxivak
maxivak / readme.md
Last active January 12, 2024 06:53
Integrating Gem/Engine and Main Rails App
@Fire-
Fire- / installDante.sh
Created October 3, 2014 19:53
Basic Dante Socks5 Server Setup and Configuration
# Basic Dante Socks5 Setup, Debian
apt-get update
apt-get install make gcc
cd /usr/src
# get newest from http://www.inet.no/dante/download.html
wget http://www.inet.no/dante/files/dante-1.4.1.tar.gz
@tadast
tadast / ssl_puma.sh
Last active January 29, 2024 04:41 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@shime
shime / _README.md
Last active April 2, 2024 17:00
getting tired of guessing tar flags in 2013?

Looks familiar?

Worry no more! Use extract and prosper!

Usage

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 13, 2024 10:59
A badass list of frontend development resources I collected over time.
vi:
devise:
confirmations:
confirmed: Xác nhận tài khoản thành công! Bạn hiện đang đăng nhập.
send_instructions: Bạn sẽ nhận được email hướng dẫn xác nhận tài khoản trong vài phút nữa.
send_paranoid_instructions: Nếu email của bạn có trong hệ thống, bạn sẽ nhận được email hướng dẫn xác nhận tài khoản trong một vài phút nữa.
failure:
already_authenticated: Bạn đã đăng nhập.
inactive: Tài khoản của bạn chưa được kích hoạt.
invalid: Email hoặc mật khẩu không chính xác.
@tjh
tjh / character_set_and_collation.rb
Created January 31, 2012 16:07
Convert all Rails table column collation and character set
#!/usr/bin/env ruby
# Put this file in the root of your Rails project,
# then run it to output the SQL needed to change all
# your tables and columns to the same character set
# and collation.
#
# > ruby character_set_and_collation.rb
DATABASE = ''
@zeke
zeke / git_workflow.sh
Created November 9, 2011 20:44
git_workflow.sh
# (Assuming master is your main branch)
# To create a local branch
git checkout -b experiment
# To push a local branch to remote
git push origin experiment
# To check out an *existing* remote branch
# (In earlier versions, you needed an explicit --track option, but now it's the default when branching off a remote branch)
@cdmwebs
cdmwebs / friendly_urls.markdown
Created September 11, 2011 15:50 — forked from jcasimir/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.