Skip to content

Instantly share code, notes, and snippets.

View henriquez's full-sized avatar

Logan henriquez

  • Google.com
  • Bay Area, CA
View GitHub Profile
@henriquez
henriquez / .json
Last active April 10, 2024 21:53
SDK reference documentation data structure
// Documentation - related data model for information seeking intents
[
//
{ "codeArray": [ { serialized code block1 }, { serialized code block 2}, .. },
"pageTitle": "page title in h element and DOM page title, includes service + function + language",
"functionText": "function description..",
"language": "python",
"githubURL" : "URL..",
"functionArguments": [ { argument type 1 }, { argument type 2 }, ... ],
"return" : [ "return value1 description", ... ],
> npm run start:dev
> crawlee@0.0.1 start:dev
> ts-node-esm -T src/main.ts
INFO PlaywrightCrawler: Starting the crawl
INFO PlaywrightCrawler: enqueueing new URLs
INFO PlaywrightCrawler: Quickstart Tutorial | Weaviate - vector database {"url":"https://weaviate.io/developers/weaviate/quickstart"}
INFO PlaywrightCrawler: How to install Weaviate | Weaviate - vector database {"url":"https://weaviate.io/developers/weaviate/installation"}
@henriquez
henriquez / editStep.svelte
Created January 23, 2020 01:01
showEditStepModal sets modalActive, but doesn't update class on the modal div
/* module export because the showEditStepModal function is called from both inside
* this component and from its parent component.
*/
<script context="module">
// activate/disactivate the modal view. Set to is-active to show this modal
let modalActive = '';
// set by the Dialog component. Determines whether select or create
// is defaulted and other behavior.
let selectOrCreate;
@henriquez
henriquez / fiver-music.json
Last active January 2, 2019 22:15
Config file for music demo
{ "user-location": "home",
"user-activity": "working"
}
@henriquez
henriquez / gist:8726070
Last active August 29, 2015 13:55
Post with NDB
def post(self):
args = self.reqparse.parse_args()
todo = Todo(title =args['title'],
description =args['description'],
due =args['due']
)
todo.put()
return { 'todo': todo.prepare_response()}, 201
import sys
import os
# required to load libraries under lib that Flask depends on
sys.path.insert(1, os.path.join(os.path.abspath('.'), 'lib'))
from lib.flask import Flask
app = Flask('scaffold_application')
@app.route('/')
@henriquez
henriquez / gist:3146782
Created July 19, 2012 21:00
Example Javascript that uses ajax proxy to make request to Chatter API
<apex:page controller="CustomerCommunityController" id="customercommunitycontroller" sidebar="false" showHeader="false" standardStylesheets="false" >
<head>
<title>Acme Customer Support</title>
<meta charset="utf-8" />
<apex:includeScript value="{!$Resource.jquery}"/>
</head>
<script type="text/javascript">
@henriquez
henriquez / gist:2776973
Created May 23, 2012 18:40
Example JSON payload from the Chatter REST API's feeds endpoint
{
"instance_url": "https://na12.salesforce.com",
"items": [{
"parent": {
"name": "John Smith",
"title": null,
"firstName": "John",
"lastName": "Smith",
"companyName": "No company locations found",
"mySubscription": null,
@henriquez
henriquez / gist:2776843
Created May 23, 2012 18:25
Example feed item post with a file attachment to the Chatter REST API
authorization: OAuth 00DU0000000J83v!AQoAQJkLzYuCPmfyTZ7Mmg.Otq3W6klMTqqXUsTUdfwMtk8BcZJxpNdyCfUmm5.0Psfr8j7xDoNnRuV8u7UtANm.E_ubaXCB
x-chatter-entity-encoding: false
accept: */*
user-agent: Ruby
content-type: multipart/form-data; boundary=-----------RubyMultipartPost
content-length: 34684
-------------RubyMultipartPost
Content-Disposition: form-data; name="json"
Content-Type: application/json; charset=UTF-8
Content-Transfer-Encoding: 8bit
@henriquez
henriquez / gist:1269141
Created October 7, 2011 00:45
parse message segments and display them in HTML
# helper that takes a feedItem hash and converts it to HTML, including
# properly structuring any included message segments like @mentions.
def message_segments(msg_segments)
# an array of hashes - each hash a segment
html = ''
msg_segments.each do |segment|
html << case segment['type']
when 'Text'
segment['text']