Skip to content

Instantly share code, notes, and snippets.

View KrishnaPG's full-sized avatar

Gopalakrishna Palem KrishnaPG

View GitHub Profile
@timbogit
timbogit / aprb_2014_soa_workshop.md
Created April 27, 2014 14:13
Script of the workshop part for the presentations

AbrilPro Ruby

SOA from the Start - Workshop Part


What will we show

We are building a set of applications that have will show deals (aka. 'inventory items') available in or near a given city. These items can also be organized by a 'category' (aka. tags), to cater to the various customers' areas of interest.

To bootstrap things, and to get us focussed on some key areas of developing in a SOA, we have gone ahead and built these apps out at varying stages. The workshops will focus on showing some of this code, and intersperse exercises to add features, or to refactor.

@zlumer
zlumer / dot_preload.js
Last active April 24, 2016 07:06
doT template preloader for browser
(function (doT) {
var templates = {};
var scripts = Array.prototype.slice.call(document.getElementsByTagName('script')); // load all scripts
for (var i = 0; i < scripts.length; i++) { // filter out template script tags
var script = scripts[i];
if (script.type == "text/dot-template") {
var name = script.id || script.getAttribute('name') || script.getAttribute('data-name');
templates[name] = script.innerHTML; // store template for later use
script.parentNode.removeChild(script); // remove template from DOM
}
@claws
claws / zsockmon.c
Last active November 24, 2016 12:35
A candidate CZMQ implementation for a ZMQ socket event monitor.
// Monitor socket transport events (tcp and ipc only)
#include "../include/czmq.h"
// remove this when zsockmon.h is properly moved into ../include
// and added to ../include/czmq.h (via adding to model/project.xml)
#include "zsockmon.h"
anonymous
anonymous / chart.vue
Created May 29, 2017 05:53
Vue.js + C3.js
<script>
import { debounce, cloneDeep, defaultsDeep } from 'lodash'
import c3 from 'c3'
require('c3/c3.css')
export default {
name: 'c3-chart',
props: {
config: {
@benmarwick
benmarwick / various_speed_tests.R
Last active January 10, 2020 19:23
Speed tests of different ways to read into R large numbers of CSV files, specifically read.csv.sql, read.csv (optimised) and fread, also of parallel processing and interactive disk storage options (filehash)
# Speed tests of different ways to read in large numbers of CSV files
# specifically read.csv.sql, read.csv (optimised) and fread
library(sqldf)
setwd("~/Downloads/wordcounts")
files <- sample(list.files(".", pattern="*.csv|CSV$"), 10000)
############# read.csv.sql ###################
system.time(
@ohvitorino
ohvitorino / cartodb20_build.sh
Last active May 21, 2020 18:11 — forked from ericmagnuson/cartodb20_build.sh
CartoDB installation on Ubuntu 12.04
###################################
## CartoDB 2.0 Install [Working] ##
## Tested on Ubuntu 12.04 ##
###################################
sudo apt-get update
sudo apt-get safe-upgrade -y
# Install miscellaneous dependencies packages
sudo apt-get install -y git-core python-software-properties openmpi-bin libopenmpi-dev build-essential libxslt-dev zlib1g-dev ruby gems unzip
@possibilities
possibilities / meteor-async.md
Created August 23, 2012 22:53
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

@timo
timo / notebook_launcher.py
Created December 19, 2011 16:26
branded ipython notebook launcher
"""==============================
Branded IPython Notebook Launcher
=================================
Executing this module will create an overlay over ipython notebooks own static
files and templates and overrides static files and templates and copies over all
example notebooks into a temporary folder and launches the ipython notebook server.
You can use this to offer an interactive tutorial for your library/framework/...
@dmajda
dmajda / indentation-based.pegjs
Created November 27, 2015 15:00
Simple intentation-based language PEG.js grammar
/*
* Simple Intentation-Based Language PEG.js Grammar
* ================================================
*
* Describes a simple indentation-based language. A program in this language is
* a possibly empty list of the following statements:
*
* * S (simple)
*
* Consists of the letter "S".
@alexey-milovidov
alexey-milovidov / nested.txt
Created June 17, 2016 21:15
Example of Nested data type in ClickHouse.
:) CREATE TABLE test.nested (EventDate Date, UserID UInt64, Attrs Nested(Key String, Value String)) ENGINE = MergeTree(EventDate, UserID, 8192)
CREATE TABLE test.nested
(
EventDate Date,
UserID UInt64,
Attrs Nested(
Key String,
Value String)
) ENGINE = MergeTree(EventDate, UserID, 8192)