This file contains 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
test: | |
override: | |
- bundle exec rake knapsack:rspec: | |
parallel: true | |
- bundle exec rake knapsack:cucumber_record_failing: | |
parallel: true | |
- bundle exec rake knapsack:cucumber_rerun: | |
parallel: true |
This file contains 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
# we don't have knapsack in our :production gems group, so the deploy would fail without this condition | |
if Rails.env.development? || Rails.env.test? | |
require 'knapsack' | |
# we have multiple nodes, so we need different files for each node | |
def failing_scenarios_filename | |
"failing_scenarios_#{ENV['CIRCLE_NODE_INDEX']}.txt" | |
end | |
namespace :knapsack do |
This file contains 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
module MyModule | |
@converter = Converter.new(:json) | |
class << self | |
def format=(format) | |
@converter.format = format | |
end | |
end | |
end |
This file contains 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
// config.js | |
var watcher = new TimeWatcher(); | |
var refresh = new RefreshAction(); | |
watcher.onPeriod(5, refresh); | |
// auster.js | |
var FsWatcher = require('./watchers/FsWatcher.js'); |
This file contains 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
function refresh() { | |
chrome.windows.getAll(function(windows) { | |
for (var i = 0; i < windows.length; i++) { | |
chrome.tabs.getAllInWindow(windows[i].id, function(tabs) { | |
chrome.storage.sync.get('active', function(object) { | |
if (object.active !== undefined) { | |
for (var j = 0; j < tabs.length; j++) { | |
if (-1 !== object.active.indexOf(tabs[j].url)) { | |
chrome.tabs.reload(tabs[j].id); | |
} |
This file contains 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 python | |
import sys, os | |
print(sys.version_info[:]) | |
if sys.version_info[0] != 2: | |
sys.argv.insert(0, "python2") | |
os.execl("/usr/bin/env", "/usr/bin/env", *sys.argv) |
This file contains 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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.clone(); |
This file contains 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
# -*- coding: utf-8 -*- | |
# https://github.com/ryanmcgrath/twython | |
from twython import Twython | |
# get your keys: https://dev.twitter.com/apps/new | |
t = Twython(app_key='jwh(...)PnQ', | |
app_secret='G2H(...)kSs', | |
oauth_token='284(...)Ytv', | |
oauth_token_secret='n8w(...)3Kk') |
This file contains 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
założenia: | |
mój czas jest wart tyle samo co czas osób, które go używają | |
dane: | |
delta_t - różnica czasu jednorazowego użycia kodu przed i po optymalizacji | |
x - prognozowana liczba użyć kodu | |
y - czas poświęcony na zoptymalizowanie kodu | |
z - prognozowana strata czasu podczas przyszłego rozwoju aplikacji | |
opłacalność = x * delta_t / (y + z) |
This file contains 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 | |
counter=1 | |
while true; do | |
espeak -p10 -s160 "question ${counter}" | |
counter=`expr 1 + $counter` | |
sleep 600 | |
done |