This file contains hidden or 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
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
print("Enter wp username") | |
user = str(input()) | |
print("Enter wp password") | |
passw = str(input()) | |
print("Enter field numbers") | |
num = int(input()) | |
driver = webdriver.Chrome('chromedriver') |
This file contains hidden or 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
from __future__ import print_function | |
import pickle | |
import os.path | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
from googleapiclient.http import MediaFileUpload, MediaIoBaseUpload | |
# If modifying these scopes, delete the file token.pickle. | |
SCOPES = ['https://www.googleapis.com/auth/drive'] |
This file contains hidden or 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
def backup | |
models = ["table1s","table2s","table3s"] | |
all_data = Hash.new | |
models.map do |model_name| | |
table_data = [] | |
model_name = model_name.split("") | |
model_name.pop | |
model_name = model_name.join("") | |
model_name.camelize.constantize.all.map do |data| | |
table_data.push(data) |
This file contains hidden or 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
Data.with_schema('schema_name').all |
This file contains hidden or 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
var array = ["2019-06-01","2019-06-02","2019-06-03"]; | |
$('#inline-datepicker').datepicker({ | |
// minDate: 0, | |
beforeShowDay: function(date) { | |
var string = jQuery.datepicker.formatDate('yy-mm-dd', date); | |
return [ array.indexOf(string) == -1 ] | |
} | |
}); |
This file contains hidden or 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
$( document ).on('turbolinks:load', function() { | |
var deferentMonth = 0; | |
var prevEl = document.getElementById('ac-prev'), // get the ID of the prev month button | |
nextEl = document.getElementById('ac-next'), // get the date of the next month button | |
daysEl = document.getElementById("custom_calndar2"); | |
const months = [ | |
"JANUARY", | |
"FEBRUARY", | |
"MARCH", | |
"APRIL", |
This file contains hidden or 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
@tenant = Apartment.tenant_names | |
@tenant.each do |name| | |
Apartment::Tenant.switch(name) do | |
@email = Account.pluck(:email) | |
end | |
end |
This file contains hidden or 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
<div><%= t = Time.parse(appointment.time) %> | |
<%= date = appointment.date %> | |
<%= d = Date.new(date.year,date.month,date.day) %> | |
<%= time = DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec) %></div> |
This file contains hidden or 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
class Task < ApplicationRecord | |
belongs_to :todo_list, optional: true | |
end |
This file contains hidden or 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
before_action :check_have, only: [:new] | |
def check_have | |
if Profile.where(:user_id=>current_user.id).present? | |
redirect_to root_path | |
end | |
end | |