Skip to content

Instantly share code, notes, and snippets.

View aspyatkin's full-sized avatar

Aleksandr Piatkin aspyatkin

View GitHub Profile
@DQNEO
DQNEO / InstallBerkshelfOnCygwin.md
Last active January 12, 2016 04:32
How to Install Berkshelf version3 on Cygwin 64bit

How to Install Berkshelf version3 on Cygwin 64bit

Installation of Berkshelf v3 on Cygwin is known to be very diffcult, but I have finally found the way. 😄

You can successfully install it by following the procedure below.

(As at 2014/6/8, v3.1.3 is available)

Why is it so difficult ?

@mcornella
mcornella / build-zsh.txt
Last active June 6, 2016 18:58
This workaround is obsolete, build 14342 solves the issue. Please use that build instead. See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-218379746
# THIS HAS BECOME OBSOLETE. IN BUILD 14342 THIS IS SOLVED, PLEASE USE THAT BUILD INSTEAD (OR MORE RECENT ONES)
# See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-218379746
# Workaround to build ZSH on #BashOnUbuntuOnWindows.
# See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-208077623
# RUN EACH LINE INDEPENDENTLY. THIS IS NOT AN AUTOMATIC BASH SCRIPT.
# Install dependencies
apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo checkinstall
@rtomayko
rtomayko / Tests Is Wrong
Created January 28, 2009 20:50
Why "require 'rubygems'" In Your Library/App/Tests Is Wrong
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
@petems
petems / check_if_ruby_is_system.sh
Created December 7, 2013 15:23
Bash Script to check if rbenv for RVM is installed
#!/bin/bash
command_exists () {
command "$1" &> /dev/null ;
}
if command_exists rbenv
then
echo 'rbenv found, no action needed'
elif command_exists rvm
@friskfly
friskfly / multiple-url-paths.lua
Created February 18, 2016 05:31 — forked from anonymous/multiple-url-paths.lua
Benchmark multiple url paths with wrk
-- Resource: https://github.com/timotta/wrk-scripts/blob/master/multiplepaths.lua
-- Initialize the pseudo random number generator
-- Resource: http://lua-users.org/wiki/MathLibraryTutorial
math.randomseed(os.time())
math.random(); math.random(); math.random()
-- Shuffle array
-- Returns a randomly shuffled array
function shuffle(paths)
@arusso
arusso / make-san-cert.rb
Last active June 1, 2021 21:20
Generating a SAN Certificate in Ruby
require 'openssl'
require 'openssl-extensions/all'
keyfile = '/tmp/mycert.key'
csrfile = '/tmp/mycert.csr'
file = File.new(keyfile,'w',0400)
key = OpenSSL::PKey::RSA.new 2048
file.write(key)
@alicial
alicial / amz-s3-bucket-policy
Created September 13, 2012 18:26
Amazon S3 Bucket Policy to prevent hot linking
{
"Version": "2008-10-17",
"Id": "0c762de8-f56b-488d-a4a4-20d1cb31df2f",
"Statement": [
{
"Sid": "Allow in my domains",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@magnetikonline
magnetikonline / LineEndings.sublime-settings
Last active October 20, 2021 18:18
Sublime Text 3 - Display file line ending details in status bar.
{
// To show line endings type on status bar
"show_line_endings_on_status_bar": true,
// show an alert when the line ending is on the list
// eg: "alert_when_line_ending_is": ["Windows","Unix","CR"]
"alert_when_line_ending_is": ["Windows"],
// auto convert line endings on file open
"auto_convert_line_endings_to": "Unix"
@benmccormick
benmccormick / minimal.vim
Last active February 26, 2022 17:09
A minimal vimrc for new vim users
" A minimal vimrc for new vim users to start with.
"
" Referenced here: http://vimuniversity.com/samples/your-first-vimrc-should-be-nearly-empty
"
" Original Author: Bram Moolenaar <Bram@vim.org>
" Made more minimal by: Ben Orenstein
" Modified by : Ben McCormick
" Last change: 2014 June 8
"
" To use it, copy it to
import os
import pytest
from alembic.command import upgrade
from alembic.config import Config
from project.factory import create_app
from project.database import db as _db