Skip to content

Instantly share code, notes, and snippets.

@ix4
ix4 / vigenere-cipher.py
Created March 14, 2020 20:33 — forked from gowhari/vigenere-cipher.py
vigenere cipher
# encoding: utf8
# vigenere cipher
# https://stackoverflow.com/a/2490718/1675586
def encode(key, string):
encoded_chars = []
for i in range(len(string)):
key_c = key[i % len(key)]
encoded_c = chr(ord(string[i]) + ord(key_c) % 256)
encoded_chars.append(encoded_c)
@ix4
ix4 / .block
Last active March 8, 2020 12:13 — forked from mbostock/.block
Collapsible Indented Tree
license: gpl-3.0
#redirect: https://observablehq.com/@d3/indented-tree
@ix4
ix4 / RobrtsRules-OrderMotions.md
Created March 7, 2020 23:44
Robert's Rules of Order Motions Chart

Robert's Rules of Order Motions Chart

Part 1, Main Motions.

These motions are listed in order of precedence. A motion can be introduced if it is higher on the chart than the pending motion.

§ indicates the section from Robert's Rules.

§ PURPOSE: YOU SAY: INTERRUPT? 2ND? DEBATE? AMEND? VOTE?
§21 Close meeting I move to adjourn No Yes No No Majority
§20 Take break I move to recess for... No Yes No Yes Majority
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>DKIM-Implementation Report</title>
<!--
.style9 {color: #275E70}
@ix4
ix4 / regex.rb
Created February 18, 2020 17:58 — forked from benbalter/regex.rb
Regular expression to find government domains for websites / email addresses
# regex to match government emails. Should detect:
# foo.gov, foo.mil
# foo.gov.uk, foo.mil.uk
# foo.fed.us
# foo.govt.nz, foo.gc.ca, foo.guv.ro, gub.uy
# note: foo.gouvt, foo.gc, foo.fed.uk, etc. will technically pass, but they are invalid domains
regex = /(\.g[ou]{1,2}(v|b|vt)|\.mil|\.gc|\.fed)(\.[a-z]{2})?$/i
@ix4
ix4 / sample.png
Created February 18, 2020 13:55 — forked from jirutka/sample.png
Nested numbered list with correct indentation in CSS. Live example at http://jsfiddle.net/a84enL8k/.
sample.png
@ix4
ix4 / backup
Created February 18, 2020 06:13
#!/bin/bash
crw=false
lrw=false
distr=$(grep -i ^ID= /etc/*release|sed s/.*ID=//)
if [ "$distr" != "ubuntu" ]
then
echo "$0 works only for Ubuntu and distros based on Ubuntu"
@ix4
ix4 / .gistup
Created February 18, 2020 06:11
gistup
@ix4
ix4 / geojson-conversion.sh
Created February 13, 2020 15:58 — forked from benbalter/geojson-conversion.sh
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
@ix4
ix4 / bytesize.js
Created February 10, 2020 04:01
Calculate byte size of a text snippet
/**
* Calculate byte size of a text snippet
* @author Lea Verou
* MIT License
*/