-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.xml
409 lines (283 loc) · 24.4 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Ed Zynda - Coder, Hacker, Superhero</title>
<link>http://www.edzynda.com/index.xml</link>
<description>Recent content on Ed Zynda - Coder, Hacker, Superhero</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<copyright>© 2016 Ed Zynda.</copyright>
<lastBuildDate>Sun, 09 Jul 2017 23:45:00 -0700</lastBuildDate>
<atom:link href="http://www.edzynda.com/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Frontend Web Applications On Ethereum Part 2</title>
<link>http://www.edzynda.com/frontend-web-applications-on-ethereum-part-2/</link>
<pubDate>Sun, 09 Jul 2017 23:45:00 -0700</pubDate>
<guid>http://www.edzynda.com/frontend-web-applications-on-ethereum-part-2/</guid>
<description><p>In this video we show how we can tie a slick looking UI to an Ethereum smart contract. We&rsquo;ll be creating a wallet application that manages a custom ERC20 token called Func Token. We&rsquo;ll show how to grab the wallet address, balance and the number of Func Tokens held.</p>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/mu9soRKREJY" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Frontend Web Applications On Ethereum Part 1</title>
<link>http://www.edzynda.com/frontend-web-applications-on-ethereum-part-1/</link>
<pubDate>Wed, 05 Jul 2017 19:45:00 -0700</pubDate>
<guid>http://www.edzynda.com/frontend-web-applications-on-ethereum-part-1/</guid>
<description><p>Ethereum allows you to create powerful smart contracts on the blockchain. The true power of Ethereum though, is the ability to create complex, decentralized applications or DApps. A great DApp ties smart contracts with an intunitive user-interface that allows the average user to leverage the power of the Ethereum network. In this video we begin to explore how to implement a web frontend that talks to our smart contracts deployed on the blockchain.</p>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/n4jrPmaaacE" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Create Your Own Cryptcurrency On Ethereum Part 2</title>
<link>http://www.edzynda.com/create-your-own-cryptcurrency-on-ethereum-part-2/</link>
<pubDate>Sat, 01 Jul 2017 13:07:00 -0700</pubDate>
<guid>http://www.edzynda.com/create-your-own-cryptcurrency-on-ethereum-part-2/</guid>
<description><p>In the previous video, I showed you how you can easily create your own ERC20 compatible token on Ethereum. In this video, we make some improvements and then tweak it so that users can purchase the token with Ethereum.</p>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/s677QFT6e4U" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Create Your Own Cryptcurrency On Ethereum Part 1</title>
<link>http://www.edzynda.com/create-your-own-cryptcurrency-on-ethereum-part-1/</link>
<pubDate>Wed, 28 Jun 2017 20:36:00 -0700</pubDate>
<guid>http://www.edzynda.com/create-your-own-cryptcurrency-on-ethereum-part-1/</guid>
<description><p>In this video, I show you just how easy it is to create your own custom token on the Ethereum blockchain. I also explain ERC20, the standard that most custom tokens follow.</p>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/JHrQ3l2tT78" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Ethereum Smart Contracts In Solidity Part 5</title>
<link>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-5/</link>
<pubDate>Mon, 26 Jun 2017 19:34:00 -0700</pubDate>
<guid>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-5/</guid>
<description><p>In this video I go over using external libraries in Solidity.</p>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/g_dVNEW_x4I" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Getting Started With Vue Router</title>
<link>http://www.edzynda.com/getting-started-with-vue-router/</link>
<pubDate>Tue, 20 Jun 2017 19:26:44 -0700</pubDate>
<guid>http://www.edzynda.com/getting-started-with-vue-router/</guid>
<description><p>I wrote a nice little tutorial on getting started with Vue Router. Check it out over at <a href="https://scotch.io/tutorials/getting-started-with-vue-router">Scotch.io</a>.</p>
</description>
</item>
<item>
<title>Ethereum Smart Contracts In Solidity Part 4</title>
<link>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-4/</link>
<pubDate>Tue, 20 Jun 2017 19:19:17 -0700</pubDate>
<guid>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-4/</guid>
<description><p>In this video I show you how to make Ethereum contracts talk to other contracts.</p>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/8BlK80eQwMA" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Ethereum Smart Contracts In Solidity Part 3</title>
<link>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-3/</link>
<pubDate>Sun, 18 Jun 2017 16:10:59 -0700</pubDate>
<guid>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-3/</guid>
<description><p>In this video I go over the concept of contract inheritance and how we can build upon an existing contract to create entirely new contracts. I also discuss abstract functions and interfaces.</p>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/kOBet0BPKzg" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Ethereum Smart Contracts In Solidity Part 2</title>
<link>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-2/</link>
<pubDate>Fri, 16 Jun 2017 18:57:30 -0700</pubDate>
<guid>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-2/</guid>
<description><p>In this video I go over how you can accept funds through your contract using &ldquo;payable&rdquo; functions. I also cover how to destroy a contract and transfer its balance once it is no longer useful to exist on the blockchain.</p>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/js319cgJvrQ" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Ethereum Smart Contracts In Solidity Part 1</title>
<link>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-1/</link>
<pubDate>Thu, 15 Jun 2017 19:06:10 -0700</pubDate>
<guid>http://www.edzynda.com/ethereum-smart-contracts-in-solidity-part-1/</guid>
<description><p>In this tutorial, I show you the basics of Ethereum smart contracts and explain state variables, functions, modifiers and events.</p>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/xWKq86PWG0o" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Create Your First Ethereum Smart Contract In Solidity</title>
<link>http://www.edzynda.com/create-your-first-ethereum-smart-contract-in-solidity/</link>
<pubDate>Wed, 14 Jun 2017 19:09:39 -0700</pubDate>
<guid>http://www.edzynda.com/create-your-first-ethereum-smart-contract-in-solidity/</guid>
<description><p>I recently started a YouTube channel for posting some tutorials. Check out my latest video on creating Ethereum smart contracts.</p>
<!-- more -->
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<iframe src="//www.youtube.com/embed/4Taej55zNY4" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe>
</div>
</description>
</item>
<item>
<title>Single Executable Web Apps With Go Binary Assets</title>
<link>http://www.edzynda.com/single-executable-web-apps-with-go-binary-assets/</link>
<pubDate>Thu, 05 Jan 2017 07:52:54 -0800</pubDate>
<guid>http://www.edzynda.com/single-executable-web-apps-with-go-binary-assets/</guid>
<description><p>Go is becoming increasingly popular with building web applications. It&rsquo;s fast, lightweight and easy to learn. Another great feature is to compile your applications into a single redistributable binary. A lot of web applications depend on external assets, however. For the application to work you still need to package your css, JavaScript and image files along with the executable. Let&rsquo;s see if we can fix this.</p>
<p></p>
<p>Imagine you have a single page web application. Your application code is saved in <code>main.go</code>. Your frontend code is saved in a folder called <code>assets</code> and called <code>app.js</code>. You also have a <code>style.css</code> and a few images. Normally you need to make sure that assets folder exists along side your <code>main</code> executable wherever you have it deployed. If not your application will complain with a bunch of <code>404 not found</code> errors.</p>
<p>In Go, it&rsquo;s possible to convert all of those files to pure Go code and then serve them up like they were sitting on the filesystem. We can accomplish this with two packages <code>jteeuwen/go-bindata</code> and <code>elazarl/go-bindata-assetfs</code>.</p>
<p>The first thing we need to do is install the packages.</p>
<pre><code class="language-bash">$ go get github.com/jteeuwen/go-bindata/...
$ go get github.com/elazarl/go-bindata-assetfs/...
</code></pre>
<p>Now we can convert our assets to Go code using the <code>go-bindata</code> CLI tool.</p>
<pre><code class="language-bash">$ go-bindata assets/
</code></pre>
<p>This will create a file called <code>bindata.go</code> in your current directory. All the code in that file will be scoped to the <code>main</code> package. To access any of our files we can use the <code>Asset(string) ([]byte, error)</code> function. Calling <code>Asset(&quot;assets/app.js&quot;)</code> will return a <code>[]byte</code> slice of the <code>app.js</code> file which we can echo through our web application manually if we wish. An easier method would be to create an endpoint that serves all of those assets as if they were on a fileserver. This is where <code>go-bindata-assetfs</code> comes in.</p>
<p>Here is an example.</p>
<pre><code>package main
import (
&quot;log&quot;
&quot;net/http&quot;
&quot;github.com/elazarl/go-bindata-assetfs&quot;
)
func main() {
// Use binary asset FileServer
http.Handle(&quot;/&quot;,
http.FileServer(
&amp;assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, AssetInfo: AssetInfo, Prefix: &quot;assets&quot;}))
log.Println(&quot;http server started on :8000&quot;)
err := http.ListenAndServe(&quot;:8000&quot;, nil)
if err != nil {
log.Fatal(&quot;ListenAndServe: &quot;, err)
}
}
</code></pre>
<p>The <code>go-bindata-assetfs</code> package includes a <code>Struct</code> type called <code>AssetFS</code> that implements the <code>http.Filesystem</code> interface which looks like this.</p>
<pre><code>type FileSystem interface {
Open(name string) (File, error)
}
</code></pre>
<p>To initialize a new <code>AssetFS</code> we need to pass a few of the helper functions generated by <code>go-bindata</code>. The final property is <code>Prefix</code> which sets the root of the <code>FileServer</code> as whatever we specify.</p>
<p>In this example we are now serving files at <code>/</code> and any files that were in <code>assets/</code> are now accessible from that path. It would be simple to place an <code>index.html</code> file to use as an entrypoint for a single page application.</p>
<p>Now we no longer have to distribute our assets along with the final executable. This makes our deployments just a little bit easier and more managable.</p></description>
</item>
<item>
<title>How Easy Is It To Containerize A Go App?</title>
<link>http://www.edzynda.com/how-easy-is-it-to-containerize-a-go-app/</link>
<pubDate>Tue, 27 Dec 2016 09:18:06 -0800</pubDate>
<guid>http://www.edzynda.com/how-easy-is-it-to-containerize-a-go-app/</guid>
<description><p>Recently, I wrote an article on how to <a href="https://scotch.io/bar-talk/build-a-realtime-chat-server-with-go-and-websockets">create a simple chat server using WebSockets and Go</a>. I made the <a href="https://github.com/scotch-io/go-realtime-chat">source code</a> available and it&rsquo;s pretty simple to get the example up and running if you have a basic familiarization with Go. I wanted to see if I could make it easier for people to try out though. For this, I looked to the very popular <a href="https://docker.io">Docker</a> project.</p>
<p>Docker has been around for quite some time but, I only recently began toying around with it more seriously. At first it seems pretty complicated but as it turns out, it&rsquo;s really simple to use once you get the hang of the basic commands and concepts.</p>
<p>This is not going to be a tutorial how to get started with Docker though, I&rsquo;m just going to run through the steps of how I turned my chat application into a redistributable container.</p>
<p>The first step is obviously to have Docker installed for your specific OS. Head on over to the <a href="https://docker.io">Docker website</a> to fetch that.</p>
<p>The next step is to create a Dockerfile in the same directory you have your app source code. This is just a file that will tell Docker how to build your container. The Dockerfile for my chat application looks just like this.</p>
<pre><code>FROM golang:1.7
MAINTAINER Ed Zynda
RUN mkdir /app
COPY . /app
WORKDIR /app/src
RUN go get -u github.com/gorilla/websocket
RUN go build main.go
CMD [&quot;./main&quot;]
</code></pre>
<p>Let&rsquo;s have a look at this line by line.</p>
<pre><code>FROM golang:1.7
</code></pre>
<p>This tells Docker that I want to start out with an official Docker container called Golang and use the tagged version 1.7. This container has all of the Golang build tools preinstalled and will provide a good base for us to build upon.</p>
<p>The Docker hub has thousands of containers provided by Docker and the community which you can download and build upon yourself. There are even containers that literally have nothing in them if you want to keep your final container as light as possible.</p>
<pre><code>MAINTAINER Ed Zynda
</code></pre>
<p>This just says that I&rsquo;m the maintainer of this container. I&rsquo;m a poet and I didn&rsquo;t even know it!</p>
<pre><code>RUN mkdir /app
COPY . /app
</code></pre>
<p>The <code>RUN</code> keyword allows us to run any command we wish inside our container. In this case I just want to create a new directory to hold our application. Next I use the <code>COPY</code> keyword to move my source code into the container.</p>
<pre><code>WORKDIR /app/src
</code></pre>
<p>This tells Docker that I now want to run commands from within the <code>/app/src</code> directory. This is just like running <code>cd /app/src</code>.</p>
<pre><code>RUN go get -u github.com/gorilla/webSocket
RUN go build main.go
</code></pre>
<p>In this step, I&rsquo;m just running the normal Go commands to pull down dependencies and then compile the application.</p>
<pre><code>CMD [&quot;./main&quot;]
</code></pre>
<p>The final step is to tell Docker which command to run when the container is started. In this case I just want to run the binary called <code>main</code> which is the result of compiling the Go source.</p>
<p>After creating my Dockerfile, I can now build the container by running the following command.</p>
<pre><code class="language-bash">docker build -t ezynda3/go-chat
</code></pre>
<p>This will build the container, following the steps in the Dockerfile and then tag it with <code>ezynda3/go-chat</code>. Since I didn&rsquo;t provide a version number the version will automatically be set to <code>latest</code>.</p>
<p>This container only exists on my machine right now though. In order to distribute it so others can use it, I need to publish it to a hub. Docker provides a free hub for public containers at <a href="https://hub.docker.com">hub.docker.com</a>. To push the container up just run the following.</p>
<pre><code class="language-bash">docker push ezynda3/go-chat
</code></pre>
<p>Docker may complain about invalid credentials. In that case run the following after ensuring you have created an account on Docker&rsquo;s hub site.</p>
<pre><code class="language-bash">docker login
</code></pre>
<p>It will prompt you for your credentials and you should be set to run the previous command again.</p>
<p>Now on any machine that has Docker installed, we can run</p>
<pre><code class="language-bash">docker pull ezynda3/go-chat
docker run -p 8000:8000 ezynda3/go-chat
</code></pre>
<p>This will pull the container and then run it mapping port <code>8000</code> from within the container to port <code>8000</code> on the host machine.</p>
<p>As you can see, it was pretty easy to create a nice simple container for a Go application.</p>
</description>
</item>
<item>
<title>Single Page Web App With Go And Vue</title>
<link>http://www.edzynda.com/single-page-web-app-with-go-and-vue/</link>
<pubDate>Wed, 07 Dec 2016 00:00:00 +0000</pubDate>
<guid>http://www.edzynda.com/single-page-web-app-with-go-and-vue/</guid>
<description><p>I wrote a nice little tutorial on creating a single page web application using Go and VueJS. Check it out over at <a href="https://scotch.io/tutorials/create-a-single-page-app-with-go-echo-and-vue">Scotch.io</a>.</p>
</description>
</item>
<item>
<title>Test The Untestable With AspectMock</title>
<link>http://www.edzynda.com/test-the-untestable-with-aspectmock/</link>
<pubDate>Tue, 26 Apr 2016 00:00:00 +0000</pubDate>
<guid>http://www.edzynda.com/test-the-untestable-with-aspectmock/</guid>
<description><p>Some of us have had the pleasure of working with someone else&rsquo;s ancient codebase to either add new features or fix bugs. It&rsquo;s never fun and usually a pain. Because of the design (or lack thereof) of the application, it doesn&rsquo;t lend itself to unit testing. The code is littered with static method calls, objects instantiated inside methods rather than being injected through a constructor, and other elements of poor design. This makes the codebase very fragile and any small change could break something if you aren&rsquo;t careful. How do we test the untestable? AspectMock to the rescue!</p>
<p>Using the power of AOP and the Go! AOP framework AspectMock allows you to create test doubles for almost anything anywhere in your code from public and private methods to static methods and even system functions like time().</p>
<p>Let&rsquo;s take a look at an example.</p>
<pre><code class="language-php">&lt;?php
class UserCreator
{
public function create(array $data)
{
$user = new User($data);
$user-&gt;save();
}
}
</code></pre>
<p>Here we have a UserCreator class that depends on a User object to save a newly created user to the database. We&rsquo;ll pretend this works great but would like to have a test in place to avoid any future defects. We need to mock the User object somehow though because we don&rsquo;t want to make any calls to the database during our test.</p>
<pre><code class="language-php">&lt;?php
function testUserCreate()
{
$user = Test::double('User', ['save' =&gt; null]));
$service = new UserCreator;
$service-&gt;create(['name' =&gt; 'Tony Stark']);
$user-&gt;verifyInvoked('save');
}
</code></pre>
<p>Now when you run your test, AspectMock basically intercepts the call to the &lsquo;save&rsquo; method and prevents it from touching the database.</p>
<p>You can even mock builtin PHP functions for greater flexibility.</p>
<pre><code class="language-php">&lt;?php
namespace demo;
test::func('demo', 'time', 'now');
$this-&gt;assertEquals('now', time());
</code></pre>
<p>AspectMock opens up a whole new world of possibilities when it comes to testing your legacy and even modern projects. Check out the project on <a href="https://github.com/Codeception/AspectMock" title="AspectMock">GitHub</a> for more detailed documentation and give it a try in one your projects.</p>
</description>
</item>
</channel>
</rss>