Skip to content

Instantly share code, notes, and snippets.

<?php
$parentId = get_the_ID();
$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'post_parent' => $parentId,
'orderby' => 'menu_order',
'order' => 'ASC'
);
$posts = get_posts($args);
#!/bin/bash
set -ex
gcc_ver=$(gcc --version | head -n 1 | awk '{print $3}')
# Install gcc 4.9 devtoolset
if [[ ! "$gcc_ver" =~ 4\.9\.* ]]; then
sudo yum install epel-release -y
sudo yum install centos-release-scl -y
from pyhive import presto
import requests
from requests.auth import HTTPBasicAuth
import pandas as pd
requests.packages.urllib3.disable_warnings()
req_kw = {
'auth': HTTPBasicAuth('the-user', 'the-password'),
'verify': '/path/to/cert.pem',
}
@tommarute
tommarute / kerberos-authentication-sample.py
Last active February 6, 2018 15:11
Sample code of kerberos auth by using prestodb. It doesn't work.
import prestodb
from prestodb.auth import KerberosAuthentication
KRB5_CONFIG = "/path/to/krb5.conf"
CA_BUNDLE = "/path/to/cert.pem"
_auth = KerberosAuthentication(
config=KRB5_CONFIG,
service_name='KERBEROS',
mutual_authentication=False,
@tommarute
tommarute / install-Renv.sh
Created December 26, 2017 13:36
Build script for Renv & R 3.3.2
#!/bin/bash
set -ex
renv_repo_url=https://github.com/viking/Renv.git
renv_dir=$HOME/.Renv
if [ ! -d "$renv_dir" ]; then
git clone $renv_repo_url $renv_dir
fi