Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
use yew::html;
use yew::prelude::*;
pub struct Component1 {
pub label: String,
pub value: u16,
}
#[derive(Default, PartialEq, Clone)]
pub struct Props {
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
app: contour
name: contour
namespace: heptio-contour
spec:
selector:
matchLabels:
/* automatically generated by rust-bindgen */
# [ repr ( C ) ] # [ derive ( Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ] pub struct __BindgenBitfieldUnit < Storage , Align > where Storage : AsRef < [ u8 ] > + AsMut < [ u8 ] >, { storage : Storage , align : [ Align ; 0 ] , } impl < Storage , Align > __BindgenBitfieldUnit < Storage , Align > where Storage : AsRef < [ u8 ] > + AsMut < [ u8 ] >, { # [ inline ] pub fn new ( storage : Storage ) -> Self { Self { storage , align : [ ] , } } # [ inline ] pub fn get_bit ( & self , index : usize ) -> bool { debug_assert ! ( index / 8 < self . storage . as_ref ( ) . len ( ) ) ; let byte_index = index / 8 ; let byte = self . storage . as_ref ( ) [ byte_index ] ; let bit_index = if cfg ! ( target_endian = "big" ) { 7 - ( index % 8 ) } else { index % 8 } ; let mask = 1 << bit_index ; byte & mask == mask } # [ inline ] pub fn set_bit ( & mut self , index : usize , val : bool ) { debug_assert ! ( index / 8 < self . storage . as_ref ( ) . len
try_handle_msg(Props, State = #cb_state{update = Update}) ->
case build_record(Props, #maestro_domain{}, undefined, update) of
{ok, Domain = #maestro_domain{name=Name}, SeqNum, Action}
when (Action == update orelse Action == delete),
is_integer(SeqNum) orelse is_list(SeqNum) ->
Timestamp = utils:datetime_to_epoch(erlang:universaltime()),
Latency = Timestamp - utils:to_i(Domain#maestro_domain.emitted_at),
case Action of
update -> hermes_domain:update(Domain);
delete -> hermes_domain:delete(Name)
package main
import (
"encoding/pem"
"flag"
"io/ioutil"
"log"
"os"
)
mentionsUs :: State -> Status -> Bool
mentionsUs State {ourUserId = uid} status =
let userids = fromMaybe [] $ (map (userEntityUserId . entityBody) . enUserMentions)
<$> statusEntities status in
any (==uid) userids
$ h apps:create -r liz
Creating guarded-harbor-7296... done, stack is cedar-14
https://guarded-harbor-7296.liz.herokuappdev.com/ | https://git.liz.herokudev.com/guarded-harbor-7296.git
Git remote liz added
$ h sudo labs:enable http-sni
Enabling http-sni for guarded-harbor-7296... done
WARNING: This feature is experimental and may change or be removed without notice.
For more information see: ask Cedar
$ git push liz master
fatal: unable to access 'https://git.liz.herokudev.com/guarded-harbor-7296.git/': SSL certificate problem: self signed certificate
#!/usr/bin/env python
def stats(f):
nums = []
for i, line in enumerate(f):
nums.append(int(line.strip()))
if i % 5 == 0:
yield (sum(nums), min(nums), max(nums))
nums = []
# The Incident Dashboard module
Rearview.module('Dashboard', (Dashboard, App, Backbone, Marionette, $, _) ->
Dashboard.Router = Backbone.Router.extend
routes: {
"dashboard(/)": "dashboard",
"dashboard/:team(/)": "dashboard"
}
## Layouts #################################################################