Skip to content

Instantly share code, notes, and snippets.

View thisolivier's full-sized avatar

Olivier thisolivier

View GitHub Profile
@thisolivier
thisolivier / functions.php
Last active June 4, 2019 09:45
Wordpress - No more media attachment or author pages
/**
* Redirect away from attachment and author pages
* Add this snippet to your functions or filters php files, as appropriate (if in doubt, the bottom of functions.php will do)
* Feel free to message thisOlivier on github/stackOverflow if you get stuck
*
*/
add_action('template_redirect', function() {
if (is_attachment() || is_author()) {
global $post;
if ($post && $post->post_parent) {
#! /usr/bin/env python
# ----------
# To use
# 1) Save this script onto your computer in a file called `bankStatementMappingScript.py`
# 2) Make sure the statement to be transformed is named ‘statement.csv’ and is in the same directory as the script
# 3) Run this script with `$ python bankStatementMappingScript.py`
# Note) This script will output a new file called ‘transformedStatement.csv’. Running the script again will replace the new file.
# ----------
# Helper functions are at the head, script body at the bottom.
class Player(object):
def __init__ (self, playerNo):
self.name = "Player {}".format(playerNo)
self.cards = {}
def play (self):
print "\n---------\nYour hand contains:"
listHand = []
for key in self.cards:
suit = self.cards[key].suit
class Classroom(object):
def __init__(self, name = "Generic Classroom"):
self.name = name
self.room = []
def add(self, childObj):
self.room.append(childObj)
return self
def allSpeak(self):
@thisolivier
thisolivier / index.html
Last active March 30, 2017 17:29
Steely Draft
<!DOCTYPE html>
<HTML>
<HEAD>
<title>A title</title>
<style>
body {
font-size: 15px;
font-family: sans-serif;
}
.icons {
@thisolivier
thisolivier / explain.js
Last active March 3, 2017 12:15
Heya G, have a look at this and see if you can figure out how its working. Vanilla JS and jQuery.
var engageSections = {
bind: function() {
var this2 = this;
$('.title-box').click(function() {
this2.open($(this));
});
$('.close-section').click(function() {
this2.close($(this));
});
},