// https://www.pcg-random.org/
fn pcg(n: u32) -> u32 {
var h = n * 747796405u + 2891336453u;
h = ((h >> ((h >> 28u) + 4u)) ^ h) * 277803737u;
return (h >> 22u) ^ h;
}
This file contains hidden or 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
| def create_batch(conn, %{"people" => people_params}) do | |
| changesets = Enum.map(people_params, fn class -> | |
| Person.changeset(%Person{}, person) | |
| end) | |
| result = changesets | |
| |> Enum.with_index() | |
| |> Enum.reduce(Ecto.Multi.new(), fn ({changeset, index}, multi) -> | |
| Ecto.Multi.insert(multi, Integer.to_string(index), changeset) | |
| end) |
This file contains hidden or 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
| OpenSimplexNoise noise; | |
| int[][] result; | |
| float t, c; | |
| float ease(float p) { | |
| return 3*p*p - 2*p*p*p; | |
| } | |
| float ease(float p, float g) { |
This file contains hidden or 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
| --- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md | |
| --- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192 | |
| -- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB. | |
| ------------ | |
| -- Basics -- | |
| ------------ | |
| -- Get indexes of tables |
Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.
|
You'll probably be working with a single smartcard, so you'll want only one primary key ( |
- 13" Macbook Pro 3.3 GHz i7 (late 2016)
- Microsoft Surface Book (2016)
- Dell up3216q 32" monitor
- rack-mini-profiler: Swiss-army knife profiler for rails apps
- flamegraph: Nice and useful timeline visualizer for debugging long methods.
- memory_profiler: Easy to use memory profiler for memory consuming methods.
- heapy: Memory dump analyzer for advanced memory analysis.
- foreman-tracer: great tool for unintrusive tracing by lzap.
If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8
To use the new phx.new project generator, you can install the archive with the following command:
$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez
Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:
This file contains hidden or 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
| var BrowserPrint = function() { | |
| function e(e) { | |
| return s + e | |
| } | |
| function n(e, n) { | |
| var i = new XMLHttpRequest; | |
| return "withCredentials" in i ? i.open(e, n, !0) : "undefined" != typeof XDomainRequest ? (i = new XDomainRequest, i.open(e, n)) : i = null, i | |
| } |
NewerOlder