Skip to content

Instantly share code, notes, and snippets.

import '@xbs/webix-pro';
import '@xbs/scheduler';
/**
*
*/
export class Mobile extends ComponentCore {
//
scheduler: any = null;
data = [{'id': 1, 'value': "{name: 'Aaron', 'Coolness': 10}"}, {'id': 2, 'value': "{name: 'Fil', 'Coolness': 10}"}]
df = sqlContext.createDataFrame(data)
# print df.rdd.collectAsMap()
import json
with open('/tmp/myoutput.json', 'w') as outfile:
json.dump(df.rdd.collectAsMap(), outfile)
# display(dbutils.fs.ls("file:/tmp/myoutput.json"))
"""
The style guide follows the strict python PEP 8 guidelines.
@see http://www.python.org/dev/peps/pep-0008/
"""
import numpy as np
def main():
"""Main execution for the feature extractor."""
@azampagl
azampagl / binarytree.cpp
Last active August 29, 2015 13:57
cpp-snippets
#include <stdio.h>
#include <QString>
/**
* @brief The BinaryTree class
*/
template <class K, class V>
class BinaryTree
{
public:
/**
* Main entry point to execute the application.
*
* @copyright (c) 2012-Present Aaron Zampaglione <azampagl@azampagl.com>
*/
path = require('path');
requirejs = require('requirejs');
// Setup requirejs.
requirejs.config({
@azampagl
azampagl / package.json
Created November 17, 2012 01:23
server.js and initial package.json
{
"analyze": false,
"author": "Aaron Zampaglione <azampagl@azampagl.com>",
"config": {
"base_url": "",
"cfd": "s",
"cookieSecret": "jnoefwjhjofewy89r3y8vdsnkjds",
"logDir": "./logs",
"uploads": "up"
},
@azampagl
azampagl / server.js
Created May 27, 2012 16:58
Joyent - NodeJS Smart Machine - Multiple application with http/https (SNI browser support required)
var http = require('http');
var https = require('https');
var httpProxy = require('http-proxy');
var crypto = require('crypto');
var fs = require('fs');
/*
* Server configurations
*/
var servers = {
@azampagl
azampagl / countrytmzs.py
Created November 11, 2011 15:01
Country code to timezone id matching.
#
# Matches a country to a timezone (if it has only one).
#
# @author Aaron Zampaglione <azampagl@azampagl.com>
# @copyright 2011 Aaron Zampaglione
# @license MIT
#
countrytmzs = {
'AD': 'Europe/Andorra',
'AE': 'Asia/Dubai',
@azampagl
azampagl / statetmzs.py
Created November 11, 2011 14:52
State to timezone conversion.
#
# Matches a state to its timezone (if it has only one).
#
# Commented out fields mean that the state
# has multiple timezones or was unknown at the time.
#
# @author Aaron Zampaglione <azampagl@azampagl.com>
# @copyright 2011 Aaron Zampaglione
# @license MIT
#
@azampagl
azampagl / countries.py
Created October 19, 2011 14:31
Country Code dictionary.
#
# Country Code dictionary.
#
ucountries = {
'AD': u'ANDORRA',
'AE': u'UNITED ARAB EMIRATES',
'AF': u'AFGHANISTAN',
'AG': u'ANTIGUA AND BARBUDA',
'AI': u'ANGUILLA',
'AL': u'ALBANIA',