Skip to content

Instantly share code, notes, and snippets.

View vaibhavgeek's full-sized avatar
🎯
Focusing

Vaibhav Maheshwari vaibhavgeek

🎯
Focusing
View GitHub Profile
@vaibhavgeek
vaibhavgeek / 1 Gist conventions
Created June 30, 2017 04:41 — forked from PavloBezpalov/1 Gist conventions
Deploy Rails 5.0.0.beta3 to VPS(Ubuntu 14.04.4 LTS). Nginx, Puma, Capistrano3, PostgreSQL, RVM.
<<APP>> change this variables
import sqlite3
conn = sqlite3.connect('RAMAN.db')
cursor = conn.execute("SELECT SYMBOL FROM ELEMENT")
elements = cursor.fetchall()
i = 0
while i < 10:
print elements[i]
i = i + 1
import urllib
VERIFY_TOKEN = 'edunova.io'
PAT = 'EAALZCRTwRe6oBAGzHzbSZBPFB7ytfXLrfGxJZCNfnEbbjU36h7HhcFsZAULaiuSnYSPLqft2otbh1VqOuGobZC24aq04vUuZCuRmS13ZC4Ne9CMH80t79lBPWbg73GfJfD5ykiTg7WqIzafcyeEHECSfRp69ZC1NCWjnQs23E8N4PQZDZD'
SEND_MESSAGE_URL = 'https://graph.facebook.com/v2.6/me/messages'
THREAD_URL = 'https://graph.facebook.com/v2.6/me/thread_settings'
CONNECTION = 'mongodb://vaibhavgeek:'+ urllib.quote('vaibhavgeek@123') + '@ds149577.mlab.com:49577/mathbot'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample Page</title>
<style type="text/css">
body, html
{
margin: 0; padding: 0; height: 100%; overflow: hidden;
}
#content
<%= form_for(@team) do |f| %>
<% if @team.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@team.errors.count, "error") %> prohibited this team from being saved:</h2>
<ul>
<% @team.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
<div class="col-md-8 col-md-offset-2 questions">
<div class="well">
<h3><%= @toload.tag_one %> </h3>
<ul class="list-group">
<label><li class="list-group-item" onclick = '$(".questions .active").removeClass("active");$(this).addClass("active");' ><%= radio_button_tag 'option', "option1" %> <%= @toload.tag_four %> </li> </label>
<label><li class="list-group-item" onclick = '$(".questions .active").removeClass("active");$(this).addClass("active");'><%= radio_button_tag 'option', "option2" %> <%= @toload.tag_five %></li></label>
<label><li class="list-group-item" onclick = '$(".questions .active").removeClass("active");$(this).addClass("active");'> <%= radio_button_tag 'option' , "option3" %> <%= @toload.tag_six %></li></label>
<label><li class="list-group-item" onclick = '$(".questions .active").removeClass("active");$(this).addClass("active");'> <%= radio_button_tag 'option' , "option4" %> <%= @toload.tag_seven %> </li></label>
# == Schema Information
#
# Table name: notewidgets
#
# id :integer not null, primary key
# note_id :integer
# tag_one :string question_text || content
# tag_two :string option1
# tag_three :string option2
# tag_four :string option3
def advacned_operation():
dic_mult = easy_multiply()
dic_div = easy_divide()
dic_add = easy_addition()
dic_sub = easy_subtraction()
question = 'Solve the expression ( %s + %s ) + ( %s - %s ) + ( %s * %s ) + ( %s / %s )' %(dic_add["param1"], dic_add['param2'],dic_sub['param1'],dic_sub['param2'],dic_mult['param1'],dic_mult['param2'],dic_div['param1'],dic_div['param2'])
answer = int(dic_add['param1']) + int(dic_add['param2']) + int(dic_sub['param1']) - int(dic_sub['param2']) + ( int(dic_mult['param1']) * int(dic_mult['param2'])) + ( int(dic_div['param1'])/int(dic_div['param2']) )
option1 = answer + 3
option2 = answer + 5
@vaibhavgeek
vaibhavgeek / util.py
Created August 14, 2016 09:05
HackInOut 3.0
import json
import requests
from constants import SEND_MESSAGE_URL, PAT as token
from random import randint
import random
import xml.etree.ElementTree
import math
def send_typing_status(recipient):
from random import randint
import random
import math
def quadeasy():
a = randint(1,7)
c = randint(1,40)
b = 2 * math.sqrt(a*c)
while(math.sqrt(a*c).is_integer() == False):
c = c+1