Skip to content

Instantly share code, notes, and snippets.

View arcolife's full-sized avatar

Archit Sharma arcolife

View GitHub Profile
import json
data = json.loads(open('_User.json','rb').read())
data
data['results'][0]
data['results'][23]
name = 'fc336b02-47e5-4a11-ba38-59e60da3dfe7-yusuf done.png"
name = 'fc336b02-47e5-4a11-ba38-59e60da3dfe7-yusuf done.png'
name.split()
'%20'.join(name.split())
data['results'][0]
@arcolife
arcolife / file1.py
Last active August 29, 2015 14:00 — forked from anonymous/file1.py
import csv
reader = csv.reader(open('1.csv', 'rb'), delimiter=',', quotechar='"')
d = {}
for row in reader:
d[row[0]] = row[1]
temp_list1 = d.keys()
set(temp_list1) & set(temp_list2)
common_Hz = set(temp_list1) & set(temp_list2)
for fq in common_Hz:
from numpy import matrix
matrix('1908 January 4.5 -5.6')
matrix("1908 'January' 4.5 -5.6")
matrix([4.5 -5.6],[2, 4])
matrix([[4.5 -5.6],[2, 4]])
matrix([[4.5 5.6],[2, 4]])
matrix([[4.5, -5.6],[2, 4]])
matrix([4.5, -5.6],[2, 4])
matrix([[4.5, -5.6],[2, 4]])
matrix([[4.5, -5.6],[2, 4]], header=['ss','b'])
import tweepy
import os
os.environ.get('TWITTER_ACCESS_TOKEN')
os.environ.get('TWITTER_ACCESS_SECRET')
consumer_secret = os.environ.get('TWITTER_SECRET')
consumer_key = os.environ.get('TWITTER_KEY')
access_token = os.environ.get('TWITTER_ACCESS_TOKEN')
access_token_secret = os.environ.get('TWITTER_ACCESS_SECRET')
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
@arcolife
arcolife / LICENSE
Created July 8, 2014 19:55
GNU LICENSE mockery. Courtesy: FOSS Community.
GNU says that the license terms go into a file called COPYING.
Go over to COPYING to read the license, then.
Or...
You stay a bit with me here and read some not really important text.
You could imagine that there was some important text here, though.
You could also imagine that you were not sitting
in your office / living room / bathroom
in front of one of these evil electronic brains
@arcolife
arcolife / file1.py
Last active August 29, 2015 14:05 — forked from anonymous/file1.py
s = df['A']
s
data['username']
data.T['username']
data = data.T
data
data[7]
data['username']
data['username']['darlene']
data['username']
@arcolife
arcolife / file1.py
Last active August 29, 2015 14:07 — forked from anonymous/file1.py
xhtml = "<h1 align='center'>Test print</h1>\n"
xhtml += "<h2>This is printed from within a Python application</h2>\n"
xhtml += "<p style=\"color:red;\">Coloured red using css</p>\n"
xhtml
from xhtml2pdf import pisa
ls
filename = "simplePrint.pdf"
pdf = pisa.CreatePDF(xhtml, file(filename, "w"))
ls
pdf = pisa.CreatePDF(xhtml.encode('utf-8, file(filename, "w"))
@arcolife
arcolife / keybase.md
Created June 20, 2016 18:48
keybase verification for github

Keybase proof

I hereby claim:

  • I am arcolife on github.
  • I am archit (https://keybase.io/archit) on keybase.
  • I have a public key whose fingerprint is 4BAF F579 66A6 0AE0 E5CB 8394 D744 5ABE EC21 84B6

To claim this, I am signing this object:

[----] W, [2016-11-30T01:33:34.478503 #9077:7d5988] WARN -- : MIQ(ManageIQ::Providers::Vmware::InfraManager::Vm#perf_capture) [realtime] For ManageIQ::Providers::Vmware::InfraManager::Vm name: [VC0DC0_C9_RP2_VM7], id: [5120], expected to get data as of [2016-11-30T04:21:40Z], but got data as of [2016-11-30T05:33:20Z].
[----] W, [2016-11-30T01:33:40.134700 #36904:7d5988] WARN -- : MIQ(ManageIQ::Providers::Vmware::InfraManager::Vm#perf_capture) [realtime] For ManageIQ::Providers::Vmware::InfraManager::Vm name: [VC0DC0_C9_RP3_VM27], id: [5290], expected to get data as of [2016-11-30T04:22:00Z], but got data as of [2016-11-30T05:33:20Z].
[----] W, [2016-11-30T01:33:42.758692 #9077:7d5988] WARN -- : MIQ(ManageIQ::Providers::Vmware::InfraManager::Vm#perf_capture) [realtime] For ManageIQ::Providers::Vmware::InfraManager::Vm name: [VC0DC0_C9_RP2_VM27], id: [5600], expected to get data as of [2016-11-30T04:22:00Z], but got data as of [2016-11-30T05:33:40Z].
[----] W, [2016-11-30T01:33:51.432584 #36904:7d5988] WARN
#!/bin/env python3
# aaabbcd -> abcd
# https://groups.google.com/forum/#!forum/dsa_sg
x = list('aaabbcd')
tmp = ''
for i in range(0,len(x),2):
# import pdb; pdb.set_trace()