Skip to content

Instantly share code, notes, and snippets.

View KrishnaPG's full-sized avatar

Gopalakrishna Palem KrishnaPG

View GitHub Profile
@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
@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.

@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@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
}
@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".
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active May 23, 2024 07:53
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@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)
@donmccurdy
donmccurdy / wildcard-to-regexp.js
Last active February 21, 2024 06:49
Wildcard and glob matching in JavaScript.
/**
* Creates a RegExp from the given string, converting asterisks to .* expressions,
* and escaping all other characters.
*/
function wildcardToRegExp (s) {
return new RegExp('^' + s.split(/\*+/).map(regExpEscape).join('.*') + '$');
}
/**
* RegExp-escapes all characters in the given string.
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: {
@garrettsickles
garrettsickles / avx2_optimized_cross_product.h
Last active October 25, 2023 10:36
AVX2 Optimized Cross Product (C, C++)
// --------------------------------------------------------------- //
// Need To Know
// _MSC_VER: Microsoft C/C++ Compiler
// __AVX2__: AVX2 Instruction Set Flag
// __FMA__: Fused Multiply Add Flag
// --------------------------------------------------------------- //
// On Windows, __AVX2__ is defined but __FMA__ so define it
#if defined(_MSC_VER) && defined(__AVX2__) && !defined(__FMA__)
#define __FMA__