Skip to content

Instantly share code, notes, and snippets.

Bartek Kruszczynski kruszczynski

Block or report user

Report or block kruszczynski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sql.md

SQL

Schema

clients
 - id
 - email
View Ruby.md

Given an array of positive integers, write a function which returns all the unique pairs which add (equal) up to 100.

Example data:

sample_data = [0, 1, 100, 99, 0, 10, 90, 30, 55, 33, 55, 75, 50, 51, 49, 50, 51, 49, 51]
sample_output = [[1,99], [0,100], [10,90], [51,49], [50,50]]
View keybase.md

Keybase proof

I hereby claim:

  • I am kruszczynski on github.
  • I am kruszczynski (https://keybase.io/kruszczynski) on keybase.
  • I have a public key ASCxlKlZxWAeFt66_f0E03h8a-_W-I0x9sooBJaxnCBPlAo

To claim this, I am signing this object:

@kruszczynski
kruszczynski / get_repos.rb
Last active Jun 21, 2019 — forked from jbarber/get_repos.rb
Github GraphQL query for repos, their topics, and Gemfile
View get_repos.rb
require 'httparty'
def get_data
query = File.open('repos.graphql', 'r').read
token = 'https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/'
cursor = nil
repos = []
org = 'evil_mega_corp'
loop do
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
View scrapfy-6evmqztwcoj8xgvi.rb
# Model
def method(argument, &block)
SomeLibrary.new.other_method(argument, &block)
end
# Test
should '#method' do
block = -> {}
block = Proc.new {}
View gist:f771f73fa2b4df80223e
Project.search do
case params[:type]
when 'healthy'
with(:health_score, 80..100)
# => [80, 81, ... , 99, 100]
when 'at_risk'
with(:health_score, 50...80)
# => [50, 51, ... , 79, 80] - should not inlcude 80, inner Sunspot Range evaluation error
end
# possible fix:
View countCSSRules.js
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
You can’t perform that action at this time.