Really, really simple demo of a slide out transition with a fade in.
A Pen by Tim Austin on CodePen.
| @echo on & @setlocal enableextensions | |
| @echo ========================= | |
| @echo Turn off the time service | |
| net stop w32time | |
| @echo ====================================================================== | |
| @echo Set the SNTP (Simple Network Time Protocol) source for the time server | |
| w32tm /config /syncfromflags:manual /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org 3.it.pool.ntp.org" | |
| @echo ============================================= | |
| @echo ... and then turn on the time service back on | |
| net start w32time |
| .toggle-content { | |
| display: none; | |
| height: 0; | |
| overflow: hidden; | |
| transition: height 350ms ease-in-out; | |
| } | |
| .toggle-content.is-visible { | |
| display: block; | |
| height: auto; |
Really, really simple demo of a slide out transition with a fade in.
A Pen by Tim Austin on CodePen.
| # Initialize the zero-valued list with 100 length | |
| zeros_list = [0] * 100 | |
| # Declare the zero-valued tuple with 100 length | |
| zeros_tuple = (0,) * 100 | |
| # Extending the "vector_list" by 3 times | |
| vector_list = [[1, 2, 3]] | |
| for i, vector in enumerate(vector_list * 3): | |
| print("{0} scalar product of vector: {1}".format((i + 1), [(i + 1) * e for e in vector])) |
| # A function that shows the results of running competitions consisting of 2 to 4 runners. | |
| def save_ranking(first, second, third=None, fourth=None): | |
| rank = {} | |
| rank[1], rank[2] = first, second | |
| rank[3] = third if third is not None else 'Nobody' | |
| rank[4] = fourth if fourth is not None else 'Nobody' | |
| print(rank) | |
| # Pass the 2 positional arguments | |
| save_ranking('ming', 'alice') |
| [ | |
| { | |
| "name": "Alberta", | |
| "abbreviation": "AB" | |
| }, | |
| { | |
| "name": "British Columbia", | |
| "abbreviation": "BC" | |
| }, | |
| { |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
| ExUnit.start() | |
| defmodule CompileTimeAssertions do | |
| defmacro assert_compile_time_raise(expected_exception, expected_message, fun) do | |
| # At compile-time, the fun is in AST form and thus cannot raise. | |
| # At run-time, we will evaluate this AST, and it may raise. | |
| fun_quoted_at_runtime = Macro.escape(fun) | |
| quote do | |
| assert_raise unquote(expected_exception), unquote(expected_message), fn -> |
In many production systems you'll want to have one module capable of talking to many potential implementations of a collaborator module (e.g a in memory cache, a redis-based cache etc). While testing it's useful to control which module the module under test is talking to.
Here are the approaches I can see. The two points that seem to divide the approaches are their tool-ability (dialyzer) and their ability to handle stateful implementations (which need a pid).
Modules are first class, so you can pass them in. Used in EEx, where passed module must implement a behaviour.
A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.
Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.