Skip to content

Instantly share code, notes, and snippets.

@vvikramjhu
vvikramjhu / a.sh
Last active August 29, 2015 14:02 — forked from anonymous/my
Face: default (sample) (customize this face)
Documentation:
Basic default face.
Defined in `faces.el'.
Family: Inconsolata
Foundry: unknown
Width: normal
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="course.labs.dangerousapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="18" />
@vvikramjhu
vvikramjhu / a.py
Last active December 30, 2015 15:09 — forked from anonymous/a.py
try:
curs.execute('REPLACE INTO nvd_cpe\
(cpe, cpe_part, cpe_vendor, cpe_product, cpe_version, cpe_update, \
cpe_edition, cpe_language) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', \
(str(nvd_cpe), str(nvd_cpe_variables[2]), str(nvd_cpe_variables[3]),
str( nvd_cpe_variables[4]), str(nvd_cpe_variables[5]), str(nvd_cpe_variables[6], )
str(nvd_cpe_variables[7]), str(nvd_cpe_variables[8])))
except Exception as e:
print "hello everyone"
print traceback.print_exc()
@vvikramjhu
vvikramjhu / python
Last active December 25, 2015 04:39 — forked from anonymous/sql errors
try:
curs.execute('INSERT INTO nvd_cpe\
(cpe, cpe_part, cpe_vendor, cpe_product, cpe_version, cpe_update, \
cpe_edition, cpe_language) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', \
(nvd_cpe, nvd_cpe_variables[2], nvd_cpe_variables[3], nvd_cpe_variables[4], \
nvd_cpe_variables[5], nvd_cpe_variables[6], nvd_cpe_variables[7],
nvd_cpe_variables[8]))
except Exception as e:
print e
# Function to print the last order row of new Order
def printOrder(d):
key = d.keys()[-1]
lpr = subprocess.Popen("/usr/bin/lpr", stdin=subprocess.PIPE)
lpr.stdin.write("OrderNo"+ str(key)+"\n")
lpr.stdin.write("Name :"+ d[key]['name'] + "\n")
lpr.stdin.write("tel :"+ str(d[key]['telephone'])+"\n")
for y in d[key]['items']:
lpr.stdin.write(y['name'] + " " + y['size'] +" " + str(y['quantity']) + " " +str(y['price']) + "\n")
lpr.stdin.write("$ "+ str(d[key]['total']) + " discount" +" "+ str(d[key]['discount']) )