Skip to content

Instantly share code, notes, and snippets.

Avatar

Juhamatti Niemelä iiska

View GitHub Profile
@iiska
iiska / webpack.config.js
Created Aug 7, 2017
Webpack configuration for my Hugo sites
View webpack.config.js
const webpack = require("webpack");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const ManifestPlugin = require("webpack-manifest-plugin");
const autoprefixer = require("autoprefixer");
const path = require("path");
module.exports = {
entry: {
main: [
"./assets/javascripts/index.js",
@iiska
iiska / keybase.txt
Created Jun 4, 2014
Keybase verification
View keybase.txt
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
owF1UntQVFUc3gXCyAIr0ZCHeNXBgl3v+55LGIqvghxt0Ikg3e7j3OUusrvuLiur
CzNQIuaoYIMgby001yKBaQbQHmIWw9YgUyhggKCkEM3oRDOCDHUvQ5M10/nrnPP7
zvf7vu93ip7x1fhoVzj9K06wCYla7yivST7a6diP8BbRhcTuR4TdMjQ71J2Zy4RI
LJIBXTxnh3rZEmm2iFBvskfOYWIQJ7TZZYtZQaF6Uo8iOTEqXH0syWYjtFltssqF
CATN4QQFJZQWeMAAQsAEXGQZnGRolGZ5liZYEic5hTLdYnf8qysyy2mQReV2Dp8w
h1+n1LJmCxyHcYQAFCbAcrzI4YAjeQySAkrSkEZRFWiHtjlLsmzP4FSxmdCWsRsa
bBbLrGPBIat1jEQxQAOMwBQ5nD1dtSdJGAcgSooUg0s0BThMEliRF1AoUCLKsBir
@iiska
iiska / candles.rb
Created Dec 4, 2012
Candle puzzle encountered in IRC
View candles.rb
#! /usr/bin/env ruby
# Finds answer to following puzzle
#
# There are one thousand candles on the altar and one thousand priests
# in the temple. Their god asks the first priest to go and light all
# the candles. Then he has the second priest go to every second candle
# and put it out."
#
# The third goes to every third candle and, if it is not burning, he
@iiska
iiska / convert.py
Created Oct 24, 2012
Convert sample.jtl to csv
View convert.py
#! /usr/bin/env python
from xml.etree import ElementTree
from xml.sax.handler import ContentHandler
from xml.sax import parse
import csv
@iiska
iiska / print_cookies.py
Created May 7, 2012
Using urllib2 and cookielib to print cookies from GET request
View print_cookies.py
import urllib2
import cookielib
cookie_jar = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie_jar))
urllib2.install_opener(opener)
request = urllib2.Request('http://www.google.com')
urllib2.urlopen(request)
@iiska
iiska / post-receive
Created Apr 2, 2012
Post-receive hook which generates html from README.md to be used with gitweb
View post-receive
#!/bin/sh
#
# Post-receive hook script which generates README.html to git-dir from
# README.md found at the head of master branch in repository.
#
# Gitweb can read the README.html and embed it to the project summary page.
git cat-file blob HEAD:README.md | markdown > $GIT_DIR/README.html
@iiska
iiska / problem-50.scm
Created Jan 31, 2012
Scheme solution for Project-Euler problem 50
View problem-50.scm
;; The prime 41, can be written as the sum of six consecutive primes: 41
;; = 2 + 3 + 5 + 7 + 11 + 13
;;
;; This is the longest sum of consecutive primes that adds to a prime
;; below one-hundred.
;;
;; The longest sum of consecutive primes below one-thousand that adds to
;; a prime, contains 21 terms, and is equal to 953.
;;
;; Which prime, below one-million, can be written as the sum of the most
@iiska
iiska / lut-helper.c
Created Jan 11, 2012
Floating point --> Fixed point --> Bit string conversion for constellation code lookup tables
View lut-helper.c
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
const double qpsk[] = {-1.0, 1.0};
const double qam16[] = {-3.0, -1.0, 3.0, 1.0};
const double qam64[] = {-7.0, -5.0, -1.0, -3.0, 7.0, 5.0, 1.0, 3.0};
/* Generic function for converting short integers to bit string
* representation.
@iiska
iiska / Autostart.sh
Created Jan 9, 2012
Using KWallet and ksshaskpass with ssh-agent
View Autostart.sh
#! /bin/bash
# Put this in ~/.kde/Autostart/ssh-agent.sh
export SSH_ASKPASS=/usr/bin/ksshaskpass
/usr/bin/ssh-add
@iiska
iiska / .ackrc
Created Dec 29, 2011
Configuration for ack tool
View .ackrc
--type-add=ruby=.haml,.rake
--type-add=css=.less
--type-add=coffeescript=.coffee
You can’t perform that action at this time.