This file contains 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
struct WorkHistoryView: View { | |
@FetchRequest(sortDescriptors: [SortDescriptor(\.createdAt, order: .reverse)]) | |
private var historyEntries: FetchedResults<WorkHistoryEntry> | |
@State var refreshCounter = 0 // Use this state var to trigger the re-rendering of the list | |
var body: some View { | |
List { | |
ForEach(historyEntries) { historyEntry in | |
WorkHistoryEntryView(historyEntry: historyEntry, refreshCounter: refreshCounter) |
This file contains 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
struct WorkHistoryView: View { | |
@SectionedFetchRequest<String, WorkHistoryEntry>( | |
sectionIdentifier: \.createdAtDate, | |
sortDescriptors: [SortDescriptor(\.createdAt, order: .reverse)] | |
) | |
private var historyEntrySections: SectionedFetchResults<String, WorkHistoryEntry> | |
var body: some View { | |
List { | |
ForEach(historyEntrySections) { historyEntrySection in |
This file contains 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
var sheetName = "_Example"; | |
var screenName = "imgracehuang"; | |
function populateFollowerCount() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheetByName(sheetName); | |
var response = fetch("https://cdn.syndication.twimg.com/widgets/followbutton/info.json?screen_names=" + screenName); | |
var followerCount; | |
if (response && response[0]) { | |
followerCount = response[0].followers_count |
This file contains 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
Ticker | Cap Size | Y2020 Performance | 2021-01 Performance (Actual) | 2021-01 Performance (In Theory) | |
---|---|---|---|---|---|
SPWR | Mid Cap | 402.06% | 82.71% | 107.73% | |
FLGT | Small Cap | 303.88% | 68.03% | 103.56% | |
EXPI | Mid Cap | 457.11% | 63.61% | 68.68% | |
MSTR | Mid Cap | 172.42% | 26.64% | 48.27% | |
CMBM | Small Cap | 186.96% | 40.11% | 45.83% | |
TCS | Small Cap | 126.07% | 23.32% | 42.87% | |
STAA | Mid Cap | 125.25% | 25.78% | 28.77% | |
CLNE | Small Cap | 235.90% | 9.02% | 28.68% | |
REGI | Mid Cap | 162.78% | 7.35% | 25.81% |
This file contains 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
// Create a dictionary for all the unique words (one … ten, eleven … nineteen, twenty, thirty, forty, … ninty) | |
var WORD_DICT = { | |
0: "", | |
1: "one", | |
2: "two", | |
3: "three", | |
4: "four", | |
5: "five", | |
6: "six", | |
7: "seven", |
This file contains 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
var express = require('express'); | |
var app = express(); | |
app.use(express.bodyParser()); | |
app.get('/is-timer-on', function(req, res) { | |
var hours = new Date().getHours() - 8; | |
if (hours >= 20 || hours <=7) { | |
res.send("false " + hours); | |
} else { |
This file contains 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
function changeLED(on) | |
pin = 1 | |
gpio.mode(pin,gpio.OUTPUT) | |
if on == true | |
then gpio.write(pin,gpio.HIGH) end | |
if on == false | |
then gpio.write(pin,gpio.LOW) end | |
end | |
changeLED(false) |
This file contains 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
--- Config | |
SSID = "YOUR_WIFI_NAME" | |
PASSWORD = "YOUR_WIFI_PASSWORD" | |
TIMEOUT = 30000000 -- 30s | |
--- Station modes | |
STAMODE = { | |
STATION_IDLE = 0, | |
STATION_CONNECTING = 1, | |
STATION_WRONG_PASSWORD = 2, |