Code Snippets ReScript

Short texts ReScript 🧑‍💻 Code snippets ReScript ✍️ Reading lists ReScript 👀

AMX Removal for CS 1.6

// // TRACKER SCHEME RESOURCE FILE // // sections: // colors – all the colors used by the scheme // basesettings – contains settings for app to use to draw controls // fonts – list of all the fonts used by app // borders – description of all the borders // // notes: // hit […]

Remove spectator UI, leave playernames only for CS 1.6

“Resource/UI/SpectatorGUI.res” { “SpectatorGUI” { “ControlName” “Frame” “fieldName” “SpectatorGUI” “tall” “480” “autoResize” “0” “pinCorner” “0” “visible” “1” “enabled” “1” “tabPosition” “0” } “TopBar” { “ControlName” “WizardSubPanel” “fieldName” “TopBar” “xpos” “0” “ypos” “0” “tall” “1” “autoResize” “0” “pinCorner” “0” “visible” “0” “enabled” “1” “tabPosition” “0” “paintbackground” “0” “WizardWide” “0” “WizardTall” “0” } “BottomBar” { “ControlName” “WizardSubPanel” “fieldName” […]

slv2.res

let getQuoteId = (x: SlvBooking.Status.t) => { switch x { | Ready(#Hibernate(Ok(#Quote(quote)))) | Ready(#FetchingQuote(#InterimQuote(quote, _), _)) => quote->Some | _ => None } } Js.log(“getQuoteId(booking.status)”) Js.log(getQuoteId(booking.status))

How should look functions in ClientScheme.res

// “SelectionEmptyBoxBg” “0 0 0 80” // “SelectionBoxBg” “0 0 0 80” // “SelectionSelectedBoxBg” “0 0 0 80” WeaponIcons { } WeaponIconsSelected { } HudSelectionNumbers { } HudSelectionText { } HudNumbersGlow { “0” { “name” “invisible” “tall” “0” [$WIN32] “tall” “0” [$X360] “weight” “0” “blur” “0” “scanlines” “0” “antialias” “0” “additive” “0” “custom” “0” } […]

pattern-matching.res

let person1 = Teacher({name: “Jane”, age: 35}) let message = switch person1 { | Teacher({name: “Mary” | “Joe”}) => `Hey, still going to the party on Saturday?` | Teacher({name}) => // this is matched only if `name` isn’t “Mary” or “Joe” `Hello ${name}.` | Student({name, reportCard: {passing: true, gpa}}) => `Congrats ${name}, nice GPA of […]