Skip to content

Instantly share code, notes, and snippets.

View ubinix-warun's full-sized avatar
🎯
Focusing

Warun C. ⚡ ubinix-warun

🎯
Focusing
View GitHub Profile
@ubinix-warun
ubinix-warun / mount_drive.sh
Last active August 29, 2015 14:02
shortcut to mount/unmount google-drive wirh google-drve-ocamlfuse (slow?) http://www.webupd8.org/2013/09/mount-google-drive-in-linux-with-google.html
#!/bin/bash
# MOUNT GOOGLE DRIVE IN LINUX WITH GOOGLE-DRIVE-OCAMLFUSE
# http://www.webupd8.org/2013/09/mount-google-drive-in-linux-with-google.html
mkdir Drive
google-drive-ocamlfuse -o big_writes Drive/
@ubinix-warun
ubinix-warun / theme.html
Created July 16, 2014 16:39
custom theme for http://ubinix-warun.postach.io/ based on Apex
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" xmlns:og="http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<title>
{% if is_login %}Login
{% elif is_home %}{{ site.author }}
{% elif is_tag %}{{ tag }}
{% elif post %}{{ post.title }}
{% endif %}
cat purchases.txt | \
awk -F'\t' '{ print $4"\t"$5 }' | \
awk -F $'\t' '{ sums[$1] += $2} END \
{ for (i in sums) printf("%s\t%f\n", i, sums[i]) }' \
| sort
{
"dataStreamId":
"derived:com.google.step_count.delta:___GDC_PRJ_ID___:Example Manufacturer:ExampleTablet:1000001:",
"dataStreamName": "",
"name": "myDataSource",
"type": "derived",
"application": {
"detailsUrl": "http://example.com",
"name": "Foo2 Example App",
"version": "1"
{
"error": {
"code": 400,
"message": "Expected dataStreamId to be: derived:com.google.step_count.delta:___GDC_PRJ_ID___:Example Manufacturer:ExampleTablet:1000001:",
"errors": [
{
"domain": "global",
"message": "Expected dataStreamId to be: derived:com.google.step_count.delta:___GDC_PRJ_ID___:Example Manufacturer:ExampleTablet:1000001:",
"reason": "invalidArgument"
}
{
"minStartTimeNs": 1397515179728708316,
"maxEndTimeNs": 1397513334728708316,
"dataSourceId":
"derived:com.google.step_count.delta:___GDC_PRJ_ID___:Example Manufacturer:ExampleTablet:1000001:",
"point": [
{
"startTimeNanos": 1397513365565713993,
"endTimeNanos": 1397513334728708316,
"dataTypeName": "com.google.step_count.delta",
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD
and shows the time.
{
"status" : {
"properties" : {
"serialId" : { "type" : "string", "index": "not_analyzed" },
"productName" : { "type" : "string", "index": "not_analyzed" },
"productSpace" : { "type" : "integer" },
"postDate" : { "type" : "date", "format": "dd-MM-yyyy HH:mm:ssZZ" }
}
}
}
curl -XDELETE 'http://localhost:9200/store'
curl -XPUT 'http://localhost:9200/store'
curl -XPUT 'http://localhost:9200/store/_mapping/product' -d '@mapping.json'
python -m esimport -s localhost:9200 -f xyz.csv -i store -t product