Skip to content

Instantly share code, notes, and snippets.

View Hendrikv1990's full-sized avatar
💭
I may be slow to respond.

Hendrik Vlaanderen Hendrikv1990

💭
I may be slow to respond.
View GitHub Profile
require 'csv'
require 'httparty'
require 'json'
header = File.open('input.tsv', &:readline) # get header from input file
header = header.to_s.gsub("\n","") # remove newline characters
header << "\t\t\tlatitude\t\t\tlongitude\n" # format header
File.open("output.tsv", 'w') {|file| file.write(header) } # create output file and append header
base_url = "http://maps.googleapis.com/maps/api/geocode/json?address="
@Hendrikv1990
Hendrikv1990 / server_configuration.sh
Created November 17, 2015 16:30 — forked from marinoszak/server_configuration.sh
ubuntu 14.04, passenger, apache, rails
#!/bin/bash
# ================================================================== #
# Ubuntu 14.04 web server build shell script
# ================================================================== #
#
# ================================================================== #
#
#
#
# ================================================================== #
@Hendrikv1990
Hendrikv1990 / gist:1656fbc1ac9ab83e75a1
Created November 21, 2015 12:39
Woocommerce to Normal Shop
Make a woocommerce shop less Woocommerce'ish
https://wordpress.org/plugins/woocommerce-admin-theme-for-shop-manager/
https://wordpress.org/plugins/wp-flatadmin/
https://wordpress.org/plugins/slate-admin-theme/
ssh-keygen
adduser username
visudo
deluser newuser
cat ~/.ssh/id_rsa.pub
CREATE DATABASE woocommerce;
CREATE USER admin@localhost;
SET PASSWORD FOR admin@localhost= PASSWORD("admin");
GRANT ALL PRIVILEGES ON woocommerce.* TO admin@localhost IDENTIFIED BY 'admin';
FLUSH PRIVILEGES;
http://stackoverflow.com/questions/11951570/mysql-create-user-with-a-variable
@Hendrikv1990
Hendrikv1990 / wp.sh
Created November 22, 2015 12:43 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
http://www.sitepoint.com/woocommerce-actions-and-filters-manipulate-cart/
https://docs.woothemes.com/wc-apidocs/class-WC_Cart.html
https://docs.woothemes.com/wc-apidocs/package-WooCommerce.Functions.Cart.html
https://gist.github.com/renegadesk/3967956
@Hendrikv1990
Hendrikv1990 / gist:ea0c8265856d705f8473
Created November 23, 2015 10:10
Woocommerce Templates
Templates work as follows in Woocommerce
> Create a php file name it template-calculator
Add the following PHP code, and go to pages, create page, name it calculator. Choose on the right the template (calculator).
All the code written in the template can be used.
<?php
/**
@Hendrikv1990
Hendrikv1990 / gist:2f5d993da992a1a93166
Last active January 18, 2016 17:47
Example for Category Hierarchies
Prefilter by Product Brands:
This is the hierarchy of the search
=Adidas (brand)
==Adidas Original (subbrand)
===Air (subsubbrand)
===Casual
==Adidas Performance
===Running
@Hendrikv1990
Hendrikv1990 / wp.sh
Created July 26, 2016 13:32 — forked from phlbnks/wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser