Skip to content

Instantly share code, notes, and snippets.

View darshilv's full-sized avatar

Darshil Vora darshilv

  • San Francisco, CA
View GitHub Profile
@darshilv
darshilv / Input.tsx
Created October 29, 2019 18:05
Sample input component for Framer X canvas
import * as React from "react"
import { Frame, addPropertyControls, ControlType } from "framer"
import { Input as SLDS_Input } from "@salesforce/design-system-react"
// Open Preview: Command + P
// Learn more: https://framer.com/api
export function Input(props) {
return <SLDS_Input {...props} />
}
@darshilv
darshilv / SimpleTextOverride.tsx
Created September 18, 2019 07:42
Example of using overrides to pass data across components and managing it in a flow
import { Data, Override } from "framer"
const data = Data({
text: "",
email: "",
})
//overrides can be shared across the components that share the property that is being overriden
export const TextInput: Override = props => {
return {
@darshilv
darshilv / Button.tsx
Last active September 18, 2019 07:03
Using Framer APIs to create an interface between LDSR and Framer X canvas
import * as React from "react"
import { addPropertyControls, ControlType } from "framer"
import { Button as SLDS_Button } from "@salesforce/design-system-react"
// Open Preview (CMD + P)
// API Reference: https://www.framer.com/api
export function Button(props) {
return (
<SLDS_Button
{...props}
@darshilv
darshilv / gi_data_sep2019.json
Last active September 20, 2019 13:42
GI Data File
[
{
"id":1,
"username":"sam_smith@nto_sales.com",
"companyname": "Northern Trail Outfitters",
"orgname": "NTO Sales NA",
"domainurl": "nto.my.salesforce.com",
"lastaccessed": "9 hrs ago",
"profile": "System Administrator",
"nickname": "ssmith",
@darshilv
darshilv / slds_installation.sh
Last active October 29, 2019 17:58
Adding Lightning Design System and Lightning Design System for React to a Framer X project
#if git has not be initialized yet uncomment the following line
#git init
yarn add @salesforce-ux/design-system @salesforce/design-system-react
git add .
git commit -m "Added Lightning Design System for React!"
#Note that git repo initiation is necessary to get rid of the alert when you open the project in Framer X.

Keybase proof

I hereby claim:

  • I am darshilv on github.
  • I am darshilv (https://keybase.io/darshilv) on keybase.
  • I have a public key ASBEjcTYR7wZ6WwrXA77uPMyI0za36bfjD_WVgZXDkj87wo

To claim this, I am signing this object:

@darshilv
darshilv / findQueryParam.js
Created April 5, 2017 17:56
function to get query parameters from url using vanilla js
function getParameterByName(name, url) {
if (!url) {
url = window.location.href;
}
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
@darshilv
darshilv / FindRename.sh
Created January 19, 2017 20:50
find files in current directory and subsequent directories within it and rename them
for f in `find . -type f -name "Enagement*" -prune -o -depth +1 -print | grep -e "/Engagement*"`
do
filepath=`echo $f | awk -F "/" '{print $2}'`
filename=`echo $f | awk -F "/" '{print $3}'`
newName="./$filepath/""Sko$filename"
mv $f $newName
done
@darshilv
darshilv / standard_git_heroku
Last active July 26, 2016 18:10
Got tired of entering the same set of commands in sequence, creating a simple bash script to avoid doing it redundantly
#!/bin/zsh
if [ $# == 0 ]; then
echo 'Usage: sh standard_git_heroku [-noremote] "message for the git update"'
exit 1
fi
# the first argument will be the message we want to add to the git commit
if [ "$1" == "-noremote" ]; then
echo "Message for Git Update: $1"
# -------------------- Create the device
# deviceType can be either "phone" or "desktop"
Framer.DeviceView.Devices["custom"] =
"deviceType": "phone"
"screenWidth": 768
"screenHeight": 442
"deviceImage": "images/Modern_TV.png"
"deviceImageWidth": 800
"deviceImageHeight": 583