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
//! # GPUI App extension example | |
//! | |
//! Add gpui to your Cargo.toml: | |
//! gpui = { git = "https://github.com/zed-industries/zed", rev = "c04c5812b6295ab683fbf1900499330cbc2b3058"} | |
use gpui::{ | |
bounds, div, hsla, point, px, size, App, AppContext as _, Application, Context, FocusHandle, | |
Global, Hsla, IntoElement, Menu, ParentElement as _, Render, Styled as _, TitlebarOptions, | |
Window, WindowBounds, WindowOptions, | |
}; |
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
use gpui::SharedString; | |
#[allow(unused)] | |
use gpui::{div, IntoElement, ParentElement, RenderOnce, Styled, WindowContext}; | |
use serde::{Deserialize, Serialize}; | |
const GRID_WIDTH: usize = 10; | |
const GRID_HEIGHT: usize = 20; | |
#[derive(Clone, Copy, Serialize, Deserialize)] | |
pub struct Block { |
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 type { Config } from 'tailwindcss'; | |
const radix_color_scale = (colorName: string) => { | |
return { | |
DEFAULT: `var(--${colorName}-9)`, | |
a1: `var(--${colorName}-a1)`, | |
a2: `var(--${colorName}-a2)`, | |
a3: `var(--${colorName}-a3)`, | |
a4: `var(--${colorName}-a4)`, | |
a5: `var(--${colorName}-a5)`, |
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 tailwindTypography from '@tailwindcss/typography'; | |
import { Config } from 'tailwindcss'; | |
import typography from './typography'; | |
const fontKeys = { | |
xs: 'xs', | |
sm: 'sm', | |
base: 'base', | |
lg: 'lg', |
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
// I spent forever trying to figure this out so I thought | |
// I'd just post this here in case someone else stumbles across it. | |
// If 'record' is your record object ("records.forEach(function (record)") | |
// You can access a field by using record.fields.YOUR_FIELD_NAME | |
// This example is me creating YAML frontmatter using fields from my Base. | |
const p = record.fields; | |
let frontMatter = { |
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
{ | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme", | |
"font_size": 18, | |
"highlight_modified_tabs": true, | |
"ignored_packages": | |
[ | |
"CodeKit", | |
"CodeKit Commands", | |
"Vintage" | |
], |
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
/* Cranebot Controller */ | |
#include <Servo.h> | |
Servo panServo; // create servo object to control a servo | |
Servo tiltServo; // create servo object to control a servo | |
int potpin = 0; // analog pin used to connect the potentiometer | |
int pan; // variable to read the value from the analog pin | |
int tilt; // variable to read the value from the analog pin |
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
// Uncomment if using jQuery | |
// $(document).ready(function(){ }); | |
// $.scrollTo(...) ScrollTo example | |
// == | |
// Parallax Code | |
// == | |
var lastPosition = -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
// Vars | |
// LED Variables | |
const int rotateLED1 = 13, | |
rotateLED2 = 12, | |
rotateLED3 = 11, | |
rotateLED4 = 10, | |
startLED = 9; | |
// Button Variables |
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
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to | |
const int analogOutPin = 13; // Analog output pin that the LED is attached to | |
int sensorValue = 0; // value read from the pot | |
int outputValue = 0; // value output to the PWM (analog out) | |
void setup() { | |
// initialize serial communications at 9600 bps: | |
Serial.begin(9600); | |
} |
NewerOlder