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
// READ EXAMPLE | |
// === vue component code === | |
const outlinerData = useQuery({ | |
queryKey: ["DiagramOutlineForView", changeSetId, viewId], | |
queryFn: async () => { | |
return await sharedWebWorker.get("DiagramOutlineForView", { viewId }, { workspaceId, changeSetId, userId }); | |
}; | |
}); |
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
import { defineStore } from "pinia"; | |
import { addStoreHooks } from "@si/vue-lib/pinia"; | |
import { reactive } from "vue"; | |
import { ChangeSetId } from "@/api/sdf/dal/change_set"; | |
import { useWorkspacesStore } from "../workspaces.store"; | |
import { useChangeSetsStore } from "../change_sets.store"; | |
import { | |
Edge, | |
RootComponent, | |
Ulid, |
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
if (identityUser.mobile == participantNum) { | |
console.log('identity does exist') | |
const participantEntry = new SideChatParticipants(participant) | |
// eslint-disable-next-line no-return-await | |
try { | |
return await participantEntry.save() | |
} catch(err) { | |
console.log(err) | |
return false // or -1, or something you can check for your error condition, or even re-reaise `err` | |
} |
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
> PROJECT_NOTES.md | |
echo "# AUTOMATED NOTE COLLECTOR" >> PROJECT_NOTES.md | |
leasot -r markdown -S --tags XXX BUG */*.py */*/*.py */templates/* */templates/*/* */static/js/* */static/scss/* assets/js/* >> PROJECT_NOTES.md | |
git add PROJECT_NOTES.md |
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
// Getting defaultdict from Python in JS | |
class DefaultDict extends Object { | |
constructor(defaultInit) { | |
return new Proxy({}, { | |
get: (target, name) => name in target ? | |
target[name] : | |
(target[name] = typeof defaultInit === 'function' ? | |
new defaultInit().valueOf() : | |
defaultInit) | |
}) |
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
import Browser | |
import Html exposing (Html, Attribute, div, input, text) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (onInput) | |
import Regex exposing (..) | |
main = | |
Browser.sandbox | |
{ init = init |
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 SourceDimension(models.Model): | |
source_id = models.IntegerField(db_index=True) | |
name = models.CharField(max_length=256, db_index=True) | |
category = models.CharField(max_length=128, default='') | |
fuzz_grouped_source_name = models.CharField(max_length=256, default='') | |
fuzz_ratio = models.PositiveIntegerField(default=0) | |
KNOWN_GOOD = [ | |
# These are first on purpose | |
'Edmunds CarCode', 'Edmunds Price Promise', 'TrueCar/USAA', |
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
# STEP 1 REMOTE | |
import datetime | |
before = datetime.date(2018, 5, 15) | |
after = datetime.date(2018, 5, 1) | |
from shelby.models import Lead | |
qs = Lead.objects.filter(created_on__date__lt=before, created_on__date__gte=after, status=Lead.STATUS_NEW).values_list('id', flat=True) | |
for lead_id in qs: | |
print(lead_id) # copy that output into "new_leads.txt" | |
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
addFoo(e, target_variable){ | |
if(e.target.checked){ | |
this.setState({ | |
show: [...this.state.show, target_variable]}) | |
}else{ | |
var index = this.state.show.indexOf('target_variable'); | |
if (index > -1) { | |
this.state.show.splice(index, 1); | |
this.setState({ | |
show: [...this.state.show,]}) |
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
xml = """<?xml version="1.0" encoding="US-ASCII" standalone="yes"?> | |
<?adf version="1.0"?> | |
<adf> | |
<prospect status="new"> | |
... | |
</prospect> | |
</adf> | |
""" | |
from bs4 import BeautifulSoup |
NewerOlder