Skip to content

Instantly share code, notes, and snippets.

View bhaavanmerchant's full-sized avatar
💭
Hakuna Matata

Bhaavan Merchant bhaavanmerchant

💭
Hakuna Matata
View GitHub Profile
from pyspark.sql import SparkSession
import pyspark.sql.types as T
import pyspark.sql.functions as func
from pyspark.sql.window import Window
def load_trades(spark):
data = [
(10, 1546300800000, 37.50, 100.000),
(10, 1546300801000, 37.51, 100.000),
(20, 1546300804000, 12.67, 300.000),
@bhaavanmerchant
bhaavanmerchant / .c
Created September 25, 2018 15:54
autogenerated git patch
diff --git a/include/uapi/linux/netfilter/xt_CONNMARK.h b/include/uapi/linux/netfilter/xt_CONNMARK.h
index 36cc956ead1a..1aa5c955ee1e 100644
--- a/include/uapi/linux/netfilter/xt_CONNMARK.h
+++ b/include/uapi/linux/netfilter/xt_CONNMARK.h
@@ -1,7 +1,42 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#ifndef _XT_CONNMARK_H_target
-#define _XT_CONNMARK_H_target
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+#ifndef _XT_CONNMARK_H
from bs4 import BeautifulSoup
import urllib2
soup = BeautifulSoup(html_doc, 'http://m.xkcd.com')
try:
img = urllib2.urlopen(soup.find_all(id='comic')[1].get_src()).read()
# do facebook stuff here
except:
pass
@bhaavanmerchant
bhaavanmerchant / RAM profile of Bullhead and Mako
Created December 21, 2016 15:50
Two devices with near identical RAM but a fairly different profile and signature of RAM Usage.
bullhead:/ $ cat /proc/meminfo
MemTotal: 1857660 kB
MemFree: 40880 kB
Buffers: 7976 kB
Cached: 445308 kB
SwapCached: 4156 kB
Active: 681412 kB
Inactive: 360836 kB
Active(anon): 508108 kB
Inactive(anon): 176064 kB
{
"VM-IDBIBK": [{
"sender": "IDBI Bank",
"senderCategory": "bank",
"entry": "Debit",
"contentCategory": "OTP",
"template": "OTP {%buffer%} generated at {%buffer%} valid for single txn with expiry of {%buffer%}. Do not disclose OTP to anyone/Bank official. Call Cust Care if not requested by you."
}],
"AD-ICICIB": [{
"sender": "ICICI Bank",