Note:
<example>is meant to denote text replaced by you (including brackets).
// global dependencies
npm install -g knex| #!/bin/bash | |
| # | |
| # Calculate checksum corresponding to the entity-tag hash (ETag) of Amazon S3 objects | |
| # | |
| # Usage: compute_etag.sh <filename> <part_size_mb> | |
| # | |
| # filename: file to process | |
| # part_size_mb: chunk size in MiB used for multipart uploads. | |
| # This is 8M by default for the AWS CLI See: | |
| # https://docs.aws.amazon.com/cli/latest/topic/s3-config.html#multipart_chunksize |
| import { decode } from "blurhash" | |
| export function blurHashToDataURL(hash: string | undefined): string | undefined { | |
| if (!hash) return undefined | |
| const pixels = decode(hash, 32, 32) | |
| const dataURL = parsePixels(pixels, 32, 32) | |
| return dataURL | |
| } |
| upstream fuel { | |
| # Defines a group of servers. Servers can listen on different ports. | |
| server IP:PORT fail_timeout=0; | |
| } | |
| upstream frontend { | |
| server IP:PORT fail_timeout=0; | |
| } |
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
| <?php | |
| function view($tmpl, $args) { | |
| $view_dir = 'views/'; | |
| foreach ($args as $k => $v) $$k = $v; | |
| ob_start(); | |
| include ("$view_dir$tmpl.php"); | |
| return ob_get_clean(); | |
| } |
| var user = { | |
| validateCredentials: function (username, password) { | |
| return ( | |
| (!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
| : (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
| : (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
| : (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
| : (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
| : false | |
| ); |