Skip to content

Instantly share code, notes, and snippets.

View vaibhavgeek's full-sized avatar
🎯
Focusing

Vaibhav Maheshwari vaibhavgeek

🎯
Focusing
View GitHub Profile
<%= 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 %>
<!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
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'
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
@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
@vaibhavgeek
vaibhavgeek / vaibhav.py
Created July 30, 2017 09:53
Vaibhav Agarwal Chatbot
#First way
#copy this console
curl -X POST -H "Content-Type: application/json" -d '{
"setting_type":"greeting",
"greeting":{
"text":"Timeless apparel for the masses."
}
}' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=PAGE_ACCESS_TOKEN"
#second way
module ApplicationCable
class Connection < ActionCable::Connection::Base
identified_by :current_chat
identified_by :current_visitor
def connect
if cookies.signed['chat'] == nil
cookies.signed['chat'] = return_random_string
end
puts cookies.signed['chat']
puts "\n this is from connection.rb file"
require 'net/http'
require 'json'
class Bots::VedicmathsController < ApplicationController
def show
@messages = Message.all
end
<ul class="messages_admin">
<li class="message right appeared">
<div class="text_wrapper">
<div class="text">
What is Vedic Maths?
</div>
</div>
</li>
@vaibhavgeek
vaibhavgeek / download.py
Created December 22, 2017 12:28
Download large files from drive using terminal
import requests
def download_file_from_google_drive(id, destination):
def get_confirm_token(response):
for key, value in response.cookies.items():
if key.startswith('download_warning'):
return value
return None