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
package main | |
import ( | |
"time" | |
) | |
func nowWithGivenTime(hour int, minutes int) (time.Time, error) { | |
today := time.Now() | |
l, err := time.LoadLocation("Local") | |
if err != nil { |
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
package main | |
import ( | |
"strconv" | |
"strings" | |
) | |
func parseTime(t string) (int, int) { | |
split := strings.Split(t, " ") | |
time := split[0] |
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
package main | |
import ( | |
"strings" | |
"regexp" | |
) | |
func getThumbnailFromStyle(style string) string { | |
r := regexp.MustCompile("url\\((.+)\\)") | |
return strings.TrimRight(strings.TrimLeft(r.FindString(style), "url("), ")") |
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
<DataTable endpoint="api.myapp.com/users"> | |
<DataTable.Column> | |
{(data) => | |
<span>{data.firstName} {data.lastName}</span> | |
)} | |
</DataTable.Column> | |
<DataTable.Column> | |
{(data) => | |
<a href={`/user/${data.id}`}>View</a> |
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
<SomeComponent.Footer> | |
{(slotProps) => | |
<div>{slotProps.loading ? 'Loading...' : null}</div> | |
} | |
</SomeComponent.Footer> |
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
// Needs Google Spreadsheets PowerTools | |
=COUNTA(valuesByColor("#f4cccc", "", B4:E4)) |
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 styling = { | |
Container: style.div` | |
padding: 16px; | |
${props => props.isBig && css` | |
padding: 32px; | |
`} | |
`, | |
Heading: styled.div` | |
display: flex; | |
`, |
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
// ++++++++++++++++ | |
// ++ ++ | |
// + + + + | |
// + + + + | |
// + + + + | |
// + + + + | |
// + + + + | |
// + ++ + | |
// + + + + | |
// + + + + |
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 layout = ( | |
<BaseLayout> | |
<BaseLayout.Header> | |
<h1>Here might be a page title</h1> | |
</BaseLayout.Header> | |
<BaseLayout.Body> | |
<p>A paragraph for the main content.</p> | |
<p>And another one.</p> | |
</BaseLayout.Body> |
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
function Header() { | |
return null | |
} | |
function Body() { | |
return null | |
} | |
function Footer() { | |
return null |