Skip to content

Instantly share code, notes, and snippets.

func (t *TCPServer) handleConnections() error {
var err error
for {
conn, err := t.server.Accept()
if err != nil || conn == nil {
err = errors.New("could not accept connection") // ineffectual assignment
break
}
go t.handleConnection(conn)
@d3chapma
d3chapma / gist:e165e0933d999920bf4264fe2f883181
Last active September 1, 2022 21:02
Logseq default queries
:default-queries
{:journals
[{:title "☀️ TODAY"
:query [:find (pull ?h [*])
:where
[?h :block/marker ?marker]
[(contains? #{"NOW"} ?marker)]
[?h :block/page ?p]
]
:result-transform (fn [result]
@d3chapma
d3chapma / index.html
Last active January 23, 2019 03:40
Fix iFrames on tochunting.com
// Anywhere that you have a video there will be an iframe tag
// You need to wrap the iframe tag in a div tag with a class of `video-container`
// You also need to remove the height and width attributes on the iframe tag
<div class='video-container'>
<iframe> // Keep the iframe tag and its contents as is, except you want to remove the width and height attributes
</div>
class Person
attr_reader :name
def initialize(name:)
@name = name
end
end
test = "My String"
<td class='quote-line-item-tool-cell'>
<div class="quote-line-item-tool-left move">
<i class="fa fa-arrows" title='Click and drag to move'></i>
</div>
</td>
<td class="center-col">
<div class="input-wrapper" data-name='part_number'>
<input type="text" value='{{part_number}}'>
</div>
</td>
module HtmlToPrawn
def self.convert(string)
tokens = string.scan(/<[^>]+>|[^<>]+/)
stack = []
output = ""
tokens.each do |token|
case token
when /<span/
output << convert_open_span(token, stack)
{
"name": "Akzo Nobel Almeda MD",
"customer": "Akzo Nobel Surface Chemistry",
"duedate": "2014-10-01"
}
<p>Hi <%= @user.profile.try(:first_name) %>,</p><br>
<p>Thanks for trying out D3M! We hope you've enjoyed your test drive so far.</p>
<p>Your D3M trial ends in 5 days but you can continue enjoying all the benefits by purchasing a subscription today.</p><br>
<p><%= link_to 'LOG IN & SETUP BILLING', plans_subscription_url,
{:style=>'color: white;
background-color: #f5a121;
border-color: #f2960b;
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
<!-- Place your styles here -->
<!doctype html>
<html>
<head>
<title>Minimal GoJS Sample</title>
<!-- Copyright 1998-2014 by Northwoods Software Corporation. -->
<link href="goSamples.css" rel="stylesheet" type="text/css"/>
<script src="http://www.gojs.net/latest/release/go.js"></script>
<script id="code">
window.DiagramManager;