Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Shivam Mishra scmmishra

🎯
Focusing
Block or report user

Report or block scmmishra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Traceback
Executing frappe.patches.v11_0.create_contact_for_user in test_site (test_frappe)
Traceback (most recent call last):
File "/opt/python/2.7.14/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/opt/python/2.7.14/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/travis/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
main()
File "/home/travis/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
click.Group(commands=commands)(prog_name='bench')
View pdf.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import pdfkit, os, frappe
from frappe.utils import scrub_urls
from frappe import _
from bs4 import BeautifulSoup
from PyPDF2 import PdfFileReader, PdfFileWriter
import re, io
@scmmishra
scmmishra / app.py
Last active Mar 8, 2019
Flask Workshop
View app.py
import os
import datetime
from flask import (Flask, flash, redirect, render_template, request,
Response, url_for, session)
from peewee import *
from playhouse.flask_utils import FlaskDB, get_object_or_404, object_list
from playhouse.sqlite_ext import *
SECRET_KEY = "secret"
View country filter
Filter by Country
<div class="text-center mt-2 mx-auto">
<select id="select-country" onchange="setCountry(this)" style="width: 250px;" class="select-country">
<option value="all">All</option>
{% for country in country_list %}
<option value="{{ country.name }}">{{ country.name }}</option>
{% endfor %}
</select>
</div>
View jsoverexplained.js
function awesomeStuff() { … }
function done() { … }
var Student = function() {
this.name = name;
}
Person.prototype.doWork = function() {
do { awesomeStuff(); } while (!done());
}
@scmmishra
scmmishra / draw_neural_net.py
Created May 24, 2018 — forked from craffel/draw_neural_net.py
Draw a neural network diagram with matplotlib!
View draw_neural_net.py
import matplotlib.pyplot as plt
def draw_neural_net(ax, left, right, bottom, top, layer_sizes):
'''
Draw a neural network cartoon using matplotilb.
:usage:
>>> fig = plt.figure(figsize=(12, 12))
>>> draw_neural_net(fig.gca(), .1, .9, .1, .9, [4, 7, 2])
@scmmishra
scmmishra / draw_neural_net.py
Created May 24, 2018 — forked from craffel/draw_neural_net.py
Draw a neural network diagram with matplotlib!
View draw_neural_net.py
import matplotlib.pyplot as plt
def draw_neural_net(ax, left, right, bottom, top, layer_sizes):
'''
Draw a neural network cartoon using matplotilb.
:usage:
>>> fig = plt.figure(figsize=(12, 12))
>>> draw_neural_net(fig.gca(), .1, .9, .1, .9, [4, 7, 2])
View linear_regression.py
import tensorflow as tf
W = tf.Variable(tf.zeros([2, 1]), name="weights")
b = tf.Variable(0., name="bias")
def inference(X):
return tf.matmul(X, W) + b
def loss(X,Y):
Y_predicted = inference(X)
View graph.py
import tensorflow as tf
# Explicitly create a Graph object
graph = tf.Graph()
with graph.as_default():
with tf.name_scope("variables"):
# Variable to keep track of how many times the graph has been run
global_step = tf.Variable(0, dtype=tf.int32, trainable=False, name="global_step")
View app.py
class Survey(flask_db.Model):
name = CharField()
department = TextField()
year = TextField()
tags = TextField()
timestamp = DateTimeField(default=datetime.datetime.now, index=True)
def save(self, *args, **kwargs):
ret = super(Survey, self).save(*args, **kwargs)
return ret
You can’t perform that action at this time.