This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream application { | |
server unix:/tmp/example_puma.sock fail_timeout=0; | |
} | |
# Optional redirect | |
#server { | |
# listen 80; | |
# server_name www.DOMAIN default; | |
# return 301 $scheme://DOMAIN$request_uri; | |
#} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/ | |
# | |
ARGS=2 | |
E_BADARGS=99 | |
if [ $# -ne $ARGS ] # correct number of arguments to the script; | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"always_show_minimap_viewport": true, | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme", | |
"enable_tab_scrolling": false, | |
"ensure_newline_at_eof_on_save": true, | |
"font_options": | |
[ | |
"gray_antialias" | |
], | |
"font_size": 13, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker rm $(docker ps -a | grep Exited | awk '{print $1}') | |
docker rmi $(docker images -f "dangling=true" -q) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_tag root_path, :method => 'get' do %> | |
<div id="remote"> | |
<input class="typeahead" type="text" name="query" placeholder="Choose the book"> | |
</div> | |
<div class="col-md-1"> | |
<button type="submit" class="btn btn-default"> | |
<% end %> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start with export LC_ALL=C && mc on OSX | |
[skin] | |
description = Solarized (mostly) dark skin for Midnight Commander. | |
256colors = true | |
[Lines] | |
horiz = ─ | |
vert = │ | |
lefttop = ┌ | |
righttop = ┐ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Even sums is a game for two players. Players are given a sequence of N positive integers and take turns alternately. In each turn, a player chooses a non-empty slice (a subsequence of consecutive elements) such that the sum of values in this slice is even, then removes the slice and concatenates the remaining parts of the sequence. The first player who is unable to make a legal move loses the game. | |
You play this game against your opponent and you want to know if you can win, assuming both you and your opponent play optimally. You move first. | |
Write a function: | |
def solution(a) | |
that, given a zero-indexed array A consisting of N integers, returns a string of format "X,Y" where X and Y are, respectively, the first and last positions (inclusive) of the slice that you should remove on your first move in order to win, assuming you have a winning strategy. If there is more than one such winning slice, the function should return the one with the smallest value of X. If there is more than one slice with the smallest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A new kind of cannon is being tested. The cannon shoots cannonballs in a fixed direction. Each cannonball flies horizontally until it hits the ground, and then it rests there. Cannonballs are shot from different heights, so they hit the ground at different points. | |
You are given two zero-indexed arrays, A and B, containing M and N integers respectively. Array A describes the landscape in the direction along which the cannon is shooting. Elements of array A represent the height of the ground, going from the cannon outwards. Array B contains levels from which consecutive cannonballs are shot. | |
Assume that a cannonball is shot at level H. | |
Let I be the smallest index, such that 0 < I < M and A[I] ≥ H. The cannonball falls at position I − 1 and increases the ground level A[I−1] by 1. | |
If there is no such I, and H > A[I] for all 0 ≤ I < M, then the cannonball flies beyond the horizon and has no effect on the result. | |
If H ≤ A[0], then the cannonball ricochets away and has no effect on the result either. | |
Write a func |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "rubygems" | |
require "bundler/setup" | |
ROOT = Pathname.new(::File.expand_path('../', __FILE__)) | |
ENVIRONMENT = ENV.fetch('STAGE', 'development') | |
Bundler.require :default, ENVIRONMENT | |
Dotenv.load ROOT.join(".env") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /etc/passwd | cut -d ":" -f1 |
NewerOlder