Skip to content

Instantly share code, notes, and snippets.

@kylelambert101
kylelambert101 / InlineTypeGuard.ts
Created May 13, 2021
TypeScript > Inline Type Guard
View InlineTypeGuard.ts
// Source: https://www.benmvp.com/blog/filtering-undefined-elements-from-array-typescript/
/* Let's say I have a list of objects of type:
MyObject {
property?: MyProperty;
}
MyProperty {
subProperty: MySubProperty;
}
And I want to filter an array of MyObjects to all of the contained MySubProperties.
@miguelmota
miguelmota / .env
Created May 13, 2021
CircleCI docker hub build and push + slack notifications
View .env
DOCKER_IMAGE=myorg/myimage
DOCKER_PASS=mydockerhubpassword
DOCKER_USER=mydockerhubusername
SLACK_ACCESS_TOKEN=myslackaccesstoken
SLACK_DEFAULT_CHANNEL=myslackchannel
@choco-bot
choco-bot / FilesSnapshot.xml
Created May 13, 2021
SqlToolbelt v2021.05.11 - Passed - Package Tests Results
View FilesSnapshot.xml
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\SqlToolbelt\SqlToolbelt.nupkg" checksum="B0E06C36DC09D1C878B3B59238D4FD94" />
<file path="C:\ProgramData\chocolatey\lib\SqlToolbelt\SqlToolbelt.nuspec" checksum="2E4F169EDE13FFBC0E0194479034B8D1" />
<file path="C:\ProgramData\chocolatey\lib\SqlToolbelt\tools\chocolateyinstall.ps1" checksum="AA55D7AFE8DE6755B0A74342CA17D74A" />
<file path="C:\ProgramData\chocolatey\lib\SqlToolbelt\tools\chocolateyuninstall.ps1" checksum="54DFCE2E293B11D7BB69A0A608E62E3F" />
</files>
</fileSnapshot>
View grafana.vue
<template>
<div class="accept-container">
<div class="go-back" v-show="goBackState" @click="goBack">GoBack</div>
<ul>
<li v-for="item in webAddress" v-bind:key="item">
<a :href="item.link" target="showHere" @click="showIframe">{{item.name}}</a>
</li>
</ul>
<iframe v-show="iframeState" id="show-iframe" frameborder=0 name="showHere" scrolling=auto src=""></iframe>
@yano404
yano404 / WeizsackerBethePlot.jl
Last active May 13, 2021
Plot Weizsäcker-Bethe Mass Formula
View WeizsackerBethePlot.jl
"""
Weizsäcker-Betheの質量公式
$$
B(Z,A)
= a_1 A
- a_2 A^{2/3}
- a_3 \frac{(A-2Z)^2}{A}
- a_4 \frac{Z^2}{A^{1/3}}
+ \delta (A)
$$
@compcon
compcon / pilot.txt
Created May 13, 2021
Rockstar - Ace Wylde (LL:1)
View pilot.txt
{"id":"614ec16a-0cc1-4310-bfc3-c42f857b9053","group":"","sort_index":0,"isLocal":true,"cloudID":"","cloudOwnerID":"","gistCode":"","gistOwner":"b742afd7-1e60-4daa-a086-afe57104d840","lastSync":"2021-04-29T18:41:31.066Z","level":1,"callsign":"Rockstar","name":"Ace Wylde","player_name":"","status":"Active","dead":false,"text_appearance":"<p>Height: 6'4\"</p><p>Weight: 210 lbs.</p><p>Hair: Black</p><p>Eyes: Green</p><p>Often sports aviator sunglasses and a leather jacket.</p>","notes":"","history":"<p>Since he could remember, Ace always enjoyed being the star of the show. He always craved fame and glory. It is what led him to start his rock band, Twilight of the Fallen Gods, in high school. It is also what led him to want to join the Union to help during SecCom. He was a bit of a show off and although he was a charmer, Ace had a hot head and was often the one to start and end fights. His superiors saw facets of Ace that could be trained and focused… weaponized.</p><p>Eventually he was recruited to the TEAMS prog
@nolde
nolde / base64.js
Created May 13, 2021 — forked from enepomnyaschih/base64.js
https://www.npmjs.com/package/byte-base64 - Encode JS Uint8Array, simple array of bytes or native JS string to base64 and back
View base64.js
/*
MIT License
Copyright (c) 2020 Egor Nepomnyaschih
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@dhruvdcoder
dhruvdcoder / notebook_script_template.py
Last active May 13, 2021
Template to start a notebook which will ultimately be converted into a script.
View notebook_script_template.py
# utils.py
from typing import List, Tuple, Union, Dict, Any, Optional
def isnotebook() -> bool:
try:
shell = get_ipython().__class__.__name__ # type:ignore
if shell == "ZMQInteractiveShell":
return True # Jupyter notebook or qtconsole
elif shell == "TerminalInteractiveShell":
View Potential Maintainers
Ignorable calculation error:
DeserializeError(Error("EOF while parsing a value", line: 1, column: 0))