Skip to content

Instantly share code, notes, and snippets.

View TomiToivio's full-sized avatar

Tomi Toivio TomiToivio

View GitHub Profile
@RyanAtViceSoftware
RyanAtViceSoftware / fiddle.html
Last active July 18, 2019 18:09
Hello React - composite components - composing components with behavior - working solution. JsFiddle: http://jsfiddle.net/gh/gist/library/pure/8312dcf44f5d583b3425
<script src="https://fb.me/react-with-addons-0.14.0.js"></script>
<script src="https://fb.me/react-dom-0.14.0.js"></script>
<div id="view"/>
@RyanAtViceSoftware
RyanAtViceSoftware / fiddle.html
Last active July 18, 2019 17:54
Hello React - composite components - how to componse simple components. JsFiddle: http://jsfiddle.net/gh/gist/library/pure/27ec782a76990860929b/
<script src="https://fb.me/react-with-addons-0.14.0.js"></script>
<script src="https://fb.me/react-dom-0.14.0.js"></script>
<div id="view"/>
@RyanAtViceSoftware
RyanAtViceSoftware / hello-react-jsx.html
Last active July 18, 2019 16:16
Hello React JSX - Hello World with ReactJs 1.3 and JSX
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Hello React</title>
<script src="https://fb.me/react-with-addons-0.14.0.js"></script>
<script src="https://fb.me/react-dom-0.14.0.js"></script>
<script src="http://fb.me/JSXTransformer-0.13.1.js"></script>
</head>
<body>
@RyanAtViceSoftware
RyanAtViceSoftware / hello-react.html
Last active July 18, 2019 16:12
Hello React - Hello World in ReactJs 1.3 without using JSX
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Hello React</title>
<script src="https://fb.me/react-with-addons-0.14.0.js"></script>
<script src="https://fb.me/react-dom-0.14.0.js"></script>
</head>
<body>
@pietromalerba
pietromalerba / woocommerce-my-account.php
Last active July 13, 2022 18:34 — forked from SiR-DanieL/functions.php
Add custom fields to Woocommerce My Account
// Add VAT and SSN fields in billing address display
add_filter( 'woocommerce_order_formatted_billing_address', 'custom_add_vat_ssn_formatted_billing_address', 10, 2 );
function custom_add_vat_ssn_formatted_billing_address( $fields, $order ) {
$fields['vat'] = $order->billing_vat;
$fields['ssn'] = $order->billing_ssn;
return $fields;
}
add_filter( 'woocommerce_my_account_my_address_formatted_address', 'custom_my_account_my_address_formatted_address', 10, 3 );
@TomiToivio
TomiToivio / geocoder-plugin.php
Last active May 6, 2016 00:43
geocoder.php
<?php
/*
Plugin Name: Geocoder Plugin Example
Plugin URI: http://api.okf.fi/console/
Description: Example WordPress Plugin for Geocoder API
Version: 1.0
Author: Tomi Toivio
Author URI: http://fi.flossmanuals.net
License: GPL2
*/

"A beginning programmer writes her programs like an ant builds her hill, one piece at a time, without thought for the bigger structure. Her programs will be like loose sand. They may stand for a while, but growing too big they fall apart.

Realizing this problem, the programmer will start to spend a lot of time thinking about structure. Her programs will be rigidly structured, like rock sculptures. They are solid, but when they must change, violence must be done to them.

The master programmer knows when to apply structure and when to leave things in their simple form. Her programs are like clay, solid yet malleable."

-- Master Yuan-Ma, The Book of Programming

@pixeline
pixeline / .gitignore
Last active October 25, 2022 01:41 — forked from redoPop/.gitignore
Default Wordpress .gitignore file
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@TikhonJelvis
TikhonJelvis / epage
Created May 10, 2014 20:30
A little pager script I wrote that calls out to emacsclient.
#! /usr/bin/env runhaskell
{-# LANGUAGE ScopedTypeVariables #-}
import Data.Functor ((<$))
import System.Directory (removeFile)
import System.Environment (getArgs)
import System.Process (runCommand)
import Text.Printf (printf)
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore