This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
attr_reader :name | |
def initialize(name:) | |
@name = name | |
end | |
end | |
test = "My String" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Akzo Nobel Almeda MD", | |
"customer": "Akzo Nobel Surface Chemistry", | |
"duedate": "2014-10-01" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; |
NewerOlder