Skip to content

Instantly share code, notes, and snippets.

View tomnagengast's full-sized avatar
🤘

Tom Nagengast tomnagengast

🤘
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tnagengast on github.
  • I am tnagengast (https://keybase.io/tnagengast) on keybase.
  • I have a public key ASDQqoU5uLcH3TqIRctJdEZXosjL71_gnCnJNvNzJ4XsSgo

To claim this, I am signing this object:

@tomnagengast
tomnagengast / tensorflow-docs-jupyter-theme-sfmono.css
Created August 22, 2019 23:35
A jupyter notebook themes based of the tensorflow docs style https://www.tensorflow.org/guide
.notebook_app {
background-color: #f7f7f7;
-webkit-font-smoothing: antialiased;
font-size: 16px;
}
#notebook-container {
background-color: none;
-webkit-box-shadow: none;
box-shadow: none;
@tomnagengast
tomnagengast / tensorflow-docs-jupyter-theme-roboto.css
Created August 22, 2019 23:35
A jupyter notebook themes based of the tensorflow docs style https://www.tensorflow.org/guide
@import url("https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i");
@import url("https://fonts.googleapis.com/css?family=Roboto+Mono:100,100i,300,300i,400,400i,500,500i,700,700i");
.notebook_app {
background-color: #f7f7f7;
-webkit-font-smoothing: antialiased;
font-size: 16px;
}
#notebook-container {
// Similar to the Lamda setup
class Model {
constructor() {}
create() {}
get() {}
update() {}
delete() {}
}
@tomnagengast
tomnagengast / UpdateItem.js
Last active August 21, 2017 19:06
DynamoDB Examples
dynamodb.updatedItem({
TableName: 'Url',
Key: {
'ShortUrl': 'short.url.example/4ua93',
},
UpdateExpression: `SET
Usage.Views = Usage.Views + :increment_by,
Usage.LastVisited = :now
`,
ExpressionAttributeValues: {
module.exports = function function_exists (funcName) { // eslint-disable-line camelcase
var attachFunction = (typeof window !== 'undefined' ? window : global)
if (typeof funcName === 'string') {
funcName = attachFunction[funcName]
}
return typeof funcName === 'function'
}
/**
* Fires the web notification api.
*/
if(window.Notification && Notification.permission !== "denied") {
// status is "granted", if accepted by user
Notification.requestPermission(function(status) {
let notify = new Notification('Title', {
body: 'I am the body text!',
// optional
/**
* Use a simple immediately-executing function to wrap the underlying "worker" function
* and return an object with properties for getting, setting, and checking existence
*/
const Objectifier = (function() {
// Utility method to get and set objects that may or may not exist
const objectifier = function(splits, create, context) {
let result = context || window;
for(let i = 0, s; result && (s = splits[i]); i++) {
post.update(request().all())
// Ability to detect if a certain attribute was changed after a model was updated
if (post.wasChanged('is_published') && post.is_published) {
Notification.send($subscriber, new NewPostNotification)
}
/**
* Consider using date fields instead of booleans.
* It works the same way, and now you know when the TRUE state happened.
*/
order.shipped = true
order.shipped = '2017-01-01 00:00:00'
subscription.cancelled = true
subscription.cancelled = '2017-01-01 00:00:00'