This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= 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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<<APP>> change this variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'json' | |
class Bots::VedicmathsController < ApplicationController | |
def show | |
@messages = Message.all | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="messages_admin"> | |
<li class="message right appeared"> | |
<div class="text_wrapper"> | |
<div class="text"> | |
What is Vedic Maths? | |
</div> | |
</div> | |
</li> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |