Skip to content

Instantly share code, notes, and snippets.

View MiniXC's full-sized avatar
🏠
Working from home

Christoph Minixhofer MiniXC

🏠
Working from home
  • Edinburgh
View GitHub Profile
We can't make this file beautiful and searchable because it's too large.
Date,News
2016-07-01,"A 117-year-old woman in Mexico City finally received her birth certificate, and died a few hours later. Trinidad Alvarez Lira had waited years for proof that she had been born in 1898."
2016-07-01,IMF chief backs Athens as permanent Olympic host
2016-07-01,"The president of France says if Brexit won, so can Donald Trump"
2016-07-01,British Man Who Must Give Police 24 Hours' Notice of Sex Threatens Hunger Strike: The man is the subject of a sexual risk order despite having never been convicted of a crime.
2016-07-01,100+ Nobel laureates urge Greenpeace to stop opposing GMOs
2016-07-01,Brazil: Huge spike in number of police killings in Rio ahead of Olympics
2016-07-01,Austria's highest court annuls presidential election narrowly lost by right-wing candidate.
2016-07-01,"Facebook wins privacy case, can track any Belgian it wants: Doesn't matter if Internet users are logged into Facebook or not"
2016-07-01,"Switzerland denies Muslim girls citizenship after they refuse to swim with boys at sc
from urllib.request import urlopen, Request
from urllib.error import HTTPError
import logging
from lxml.html import parse
def yahoo_scrape(symbol_string):
"""
returns the string sector for a given symbol
"""
sector_string = ''
import Data.Char
import Test.QuickCheck
-- count str = length [c | c <- str, isUpper c || isDigit c]
count = length . filter c
where c x = isUpper x || isDigit x
countRec [] = 0
countRec (c:str) = (if isUpper c || isDigit c then 1 else 0) + countRec str
-- Informatics 1 - Functional Programming
-- Tutorial 3
--
-- Week 5 - Due: 19-20 Oct.
module Tutorial3 where
import Data.Char
import Test.QuickCheck
halveEvens :: [Int] -> [Int]
halveEvens xs = [x `div` 2 | x <- xs, x `mod` 2 == 0]
@MiniXC
MiniXC / remscroll.js
Last active September 18, 2017 09:10
remembers and sets the scrolling position of the current page after reload
var href = 'remscroll.js:' + window.location.href;
window.addEventListener('load', () => {
let scrollPos = localStorage.getItem(href);
if(scrollPos) {
document.scrollingElement.scrollTop = Number(scrollPos);
}
});
document.addEventListener('scroll', () => {
const keva = require('keva');
module.exports = (name, json) => {
let schema = {
definitions: {},
title: name,
type: 'object',
properties: json
};
schema.properties = convert(schema.properties, schema.definitions);
@MiniXC
MiniXC / comic-log.js
Created July 14, 2017 13:05
Replaces default font-family used in console.log with Comic Sans MS
console.log=(()=>{var c=console.log;return(...d)=>{c(...(1==d.length&&d[0].charAt?['%c'+d[0],'font:1em Comic Sans MS']:d))}})();
google-site-verification: googledf49824418c4dc3a.html
@MiniXC
MiniXC / attributeeditable.js
Last active January 4, 2017 20:46
Makes attributes with the attributeeditable attribute editable. Demo: http://codepen.io/MiniXC/pen/mOXqyP
let observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if(mutation.attributeName === "attributeeditable") {
if(mutation.target.hasAttribute("attributeeditable") && mutation.target.getAttribute("attributeeditable") !== 'false') {
createPopovers();
} else {
editAttributes(mutation.target);
mutation.target.removeAttribute("data-attributeeditable");
}
}