Skip to content

Instantly share code, notes, and snippets.

View designer.html
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<link rel="import" href="../topeka-elements/theme.html">
View designer.html
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../google-map/google-map.html">
View pun_service.js
getRandomPun(): Promise<Pun> {
return this.client.db('punbot').collection('puns').aggregate([
{ '$sample': { 'size': 1 } }
]).toArray().then(result => {
if (result.length) {
return result[0];
}
return undefined;
}).catch(err => {
console.error(err);
View post_slack_message.js
import { WebClient } from '@slack/client'
postMessage(teamData: TeamData, channel: string, text: string): Promise<any> {
const web = new WebClient(teamData.bot.bot_access_token);
return web.chat.postMessage({
channel: channel.substring(2, channel.length-1),
text: text
})
}
View black.css
body { background: #222; color: #e6e6e6; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #222; }
View gist:05575ffdfea5095673bc2a75019a85f1
using System;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
namespace ef_play
{
class Program
{
public class Blog
View Program.cs
using System;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
namespace ef_play
{
class Program
{
public class Blog
View App.js
import React, { useState, useEffect, useRef } from 'react';
const states = {
PromptUserToMovePointer: "Move your cursor around",
PromptUserToHoldStill: "Hold still!",
DisplayingCat: "Displaying cat..."
}
export default ({ }) => {
const [uiState, setUiState] = useState(states.PromptUserToMovePointer)
View keybase.md

Keybase proof

I hereby claim:

  • I am deslee on github.
  • I am desmondl (https://keybase.io/desmondl) on keybase.
  • I have a public key ASCLSO1RCJDwpykzSivQuOfgOCSQFVCHWKcak6Aj1Q1BLQo

To claim this, I am signing this object:

View led_strip.py
# Simple test for NeoPixels on Raspberry Pi
import threading
import board
import neopixel
import colorsys
from random import randint
def hsv2rgb(h,s,v):
return tuple(round(i * 255) for i in colorsys.hsv_to_rgb(h,s,v))