Skip to content

Instantly share code, notes, and snippets.

View merge_files.py
import csv
import glob
from datetime import datetime
def process_file():
data = []
for filename in glob.glob("csse_covid_19_data/csse_covid_19_daily_reports/*.csv"):
with open(filename, "r") as csvfile:
reader = csv.reader(csvfile)
View keybase.md

Keybase proof

I hereby claim:

  • I am bani on github.
  • I am bani (https://keybase.io/bani) on keybase.
  • I have a public key ASB6bQcID9mxh9UpeFkU4W-w1a4neKqar_glFpnhN64eTQo

To claim this, I am signing this object:

@bani
bani / pebble_set_background.c
Created Feb 16, 2016
Pebble watchface background image example code
View pebble_set_background.c
static void set_background_gem(int color) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating background gem");
if (s_bitmap) gbitmap_destroy(s_bitmap);
switch(color) {
case 0:
s_bitmap = gbitmap_create_with_resource(RESOURCE_ID_DIAMOND);
break;
case 1:
s_bitmap = gbitmap_create_with_resource(RESOURCE_ID_DIAMONDAQUA);
break;
@bani
bani / pebble_inbox_received_handler.c
Created Feb 16, 2016
inbox_received_handler C implementation for Pebble configuration
View pebble_inbox_received_handler.c
static void inbox_received_handler(DictionaryIterator *iter, void *context) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "New gem color received");
Tuple *gem_color_t = dict_find(iter, KEY_GEM_COLOR);
if (gem_color_t) {
int gem_color = gem_color_t->value->int32;
persist_write_int(KEY_GEM_COLOR, gem_color);
set_background_gem(gem_color);
Layer *window_layer = window_get_root_layer(window);
layer_mark_dirty(window_layer);
@bani
bani / ga-ec-actions.liquid
Last active Aug 29, 2015
Add to product.liquid
View ga-ec-actions.liquid
<script type="text/javascript">
ga('ec:addProduct', {
'id': '{{ product.id }}',
'name': '{{product.title}}',
'category': '{{product.type}}',
'brand': '{{product.vendor}}'
});
ga('ec:setAction', 'detail');
</script>
@bani
bani / ga-ec-impressions.liquid
Created Jul 20, 2014
Add inside {% for product in collection.products %} in collection.liquid
View ga-ec-impressions.liquid
<script type="text/javascript">
ga('ec:addImpression', {
'id': '{{ product.id }}',
'name': '{{product.title}}',
'category': '{{product.type}}',
'brand': '{{product.vendor}}',
'list': '{{collection.title}}'
});
</script>
@bani
bani / ga-ec-transactions.liquid
Last active Aug 29, 2015
Code to be added to Checkout under "Additional content & scripts" in order to send transaction data to Google Analytics using Enhanced Ecommerce (Universal)
View ga-ec-transactions.liquid
<script type="text/javascript">
{% for line_item in order.line_items %}
ga('ec:addProduct', {
'id': '{{line_item.id}}',
'name': '{{line_item.product.title}}',
'category': '{{line_item.product.type}}',
'brand': '{{line_item.vendor}}',
'variant': '{{line_item.variant.option1}} {{line_item.variant.option2}} {{line_item.variant.option3}}',
'price': '{{line_item.price | money_without_currency}}',
'quantity': {{line_item.quantity}}