Skip to content

Instantly share code, notes, and snippets.

View bitkidd's full-sized avatar
🎯
Focusing

Chirill Ceban bitkidd

🎯
Focusing
View GitHub Profile
@bitkidd
bitkidd / uri.js
Last active January 18, 2018 21:01 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a')
parser.href = "http://example.com:3000/pathname/?search=test#hash"
parser.protocol // => "http:"
parser.host // => "example.com:3000"
parser.hostname // => "example.com"
parser.port // => "3000"
parser.pathname // => "/pathname/"
parser.hash // => "#hash"
parser.search // => "?search=test"
@bitkidd
bitkidd / script.sh
Created December 7, 2017 20:28 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@bitkidd
bitkidd / .gitlab-ci.yml
Created July 27, 2017 15:23 — forked from comilab/.gitlab-ci.yml
GitLab.com + GitLab-CI + Shared runners + gulp + rsyncで自動デプロイ
image: node:latest
cache:
paths:
- node_modules/
before_script:
- apt-get update -y
- apt-get install rsync openssh-client -y
- npm install
@bitkidd
bitkidd / db_truncate_x.rb
Created April 25, 2016 22:38 — forked from kazukeyan/db_truncate_x.rb
add rake task "db:truncate:x" and "db:truncate:all"
namespace :db do
def detect_env
ENV['RAILS_ENV'] || 'development'
end
def truncate(table)
begin
case @config["adapter"]
when "mysql", "mysql2"
ActiveRecord::Base.connection.execute("TRUNCATE #{table}")
puts "Table #{table} truncated!"
@bitkidd
bitkidd / install-comodo-ssl-cert-for-nginx.rst
Created April 5, 2016 20:17 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@bitkidd
bitkidd / routes.rb
Created January 27, 2016 13:36 — forked from kryzhovnik/routes.rb
Интеграция Яндекс.Кассы с Rails
# config/routes.rb
YandexKassaIntegration::Application.routes.draw do
# ...
scope '/yandex_kassa' do
controller 'yandex_kassa', constraints: { subdomain: 'ssl' } do
post :check
post :aviso
get :success
get :fail
@bitkidd
bitkidd / rails_passenger_setup.md
Last active February 15, 2016 19:10 — forked from ChuckJHardy/digital_ocean_setup.md
Ubuntu 14.04 x64 + RVM + NVM + Node.js + Rails 4 + Nginx + Passenger + PostgreSQL

Ubuntu 14.04 x64 + RVM + NVM + Node.js + Rails 4 + Nginx + Passenger + PostgreSQL

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

$ passwd