Skip to content

Instantly share code, notes, and snippets.

View kruszczynski's full-sized avatar
🎛️
Softer Developer

Bartek Kruszczynski kruszczynski

🎛️
Softer Developer
View GitHub Profile
@kruszczynski
kruszczynski / get_repos.rb
Last active June 14, 2023 15:35 — forked from jbarber/get_repos.rb
Github GraphQL query for repos, their topics, and Gemfile
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
@kruszczynski
kruszczynski / postgres_queries_and_commands.sql
Created January 2, 2018 15:15 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- 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%'
# Model
def method(argument, &block)
SomeLibrary.new.other_method(argument, &block)
end
# Test
should '#method' do
block = -> {}
block = Proc.new {}
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) {