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
window.onload = function() { | |
console.log('window.onload event fired'); | |
// Find the button by data-pp-command attribute | |
var button = document.querySelector('[data-pp-command="instructForm"]'); | |
// Check if the button is found | |
if (button) { | |
// Modify the button label | |
button.innerText = 'Instruct'; // Replace 'New Button Label' with your desired label |
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-view="newMatterForm"] .intake-form-template-2 .matter-type-icon, | |
[data-view="newMatterForm"] .intake-form-template-3 .matter-type-icon { | |
width: 100px !important; | |
height: 100px !important; | |
} | |
.matter-type-icon .circle-matter-type { | |
width: 100%; | |
height: 100% |
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
{"toggle":[{"target":"newMatterSelector","status":0},{"target":"newMatterContent","status":1},{"target":"newMatterLoading","status":0}],"html":" | |
<div class=\"row\">\n | |
<div class=\"pp-col-xs-24\">\n | |
<h2 class=\"text-center\">THANK YOU!<\/h2>\n | |
<p class=\"text-center\">Thank you for your information.<br \/> | |
A member of our team will be in touch shortly.<\/p>\n <\/div>\n<\/div>\n | |
<div class=\"gap15\"><\/div>","scroll":0,"update":{"postcode":""}} |
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
{"html":" | |
<h3>Your Estimate<\/h3>\n | |
<div class=\"pp-quote-container\">\n | |
<div class=\"row\">\n | |
<div class=\"pp-col-xs-24 pp-col-sm-24\">\n | |
<div class=\"row\">\n | |
<div class=\"pp-col-xs-24 pp-col-sm-12 pp-hidden-xs\">\n | |
<h4 class=\"margin0\">Your Details<\/h4>\n | |
<p>We have not saved your details as you did not consent to being contacted.<\/p>\n \n <\/div>\n | |
<div class=\"pp-col-xs-24 pp-col-sm-12\">\n |
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
//set timeout for network request and show exception | |
await axios | |
.post(`${API_URL}/bank/verify`, { | |
...data, | |
}) | |
.then((res) => { | |
setStatus({ | |
status: res.data, | |
type: 'info', | |
}) |
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
/** | |
* Made a few tweaks from Miguel's original code to... | |
* meet my usecase. | |
*/ | |
import dayjs from 'dayjs'; | |
import utc from 'dayjs/plugin/utc'; | |
import customParseFormat from 'dayjs/plugin/customParseFormat'; | |
import timezone from 'dayjs/plugin/timezone'; | |
dayjs.extend(utc); |
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
[ | |
{ | |
"city": "New York", | |
"growth_from_2000_to_2013": "4.8%", | |
"latitude": 40.7127837, | |
"longitude": -74.0059413, | |
"population": "8405837", | |
"rank": "1", | |
"state": "New York" | |
}, |
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 counter(func): | |
""" | |
A decorator that counts and prints the number of times a function has been executed | |
""" | |
def wrapper(*args, **kwargs): | |
wrapper.count = wrapper.count + 1 | |
res = func(*args, **kwargs) | |
print '{0} has been used: {1}x'.format(func.__name__, wrapper.count) | |
return res | |
wrapper.count = 0 |
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
# Link to repo: https://github.com/PaulSebalu/bookstore | |
# using the interactive shell: "python manage.py shell" | |
from django.db.models import Count | |
from store.models import Author | |
authors=Author.objects.annotate(Count('book')).order_by('-book__count') | |
for author in authors: | |
f"{author.name}. {author.book__count}" |
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
# Link to repo: https://github.com/PaulSebalu/bookstore | |
# using the interactive shell: "python manage.py shell" | |
from django.db.models import Prefetch | |
from store.models import Author | |
authors=Author.objects.prefetch_related(Prefetch("book_set")).all() | |
for author in authors: | |
f"{author.name}:{author.book_set.all()}" | |
NewerOlder