I hereby claim:
- I am ralexandr on github.
- I am ralexandr (https://keybase.io/ralexandr) on keybase.
- I have a public key ASDbzNl2VRbjwBC3GDSpbksTPvIndhxth7SSObc96ovdoQo
To claim this, I am signing this object:
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
I hereby claim:
To claim this, I am signing this object:
function nearestMinutes(interval, someMoment) { | |
const roundedMinutes = Math.round(someMoment.clone().minute() / interval) * interval; | |
return someMoment.clone().minute(roundedMinutes).second(0); | |
} | |
function nearestPastMinutes(interval, someMoment) { | |
const roundedMinutes = Math.floor(someMoment.minute() / interval) * interval; | |
return someMoment.clone().minute(roundedMinutes).second(0); | |
} |
function resize (file, maxWidth, maxHeight, fn) { | |
var reader = new FileReader(); | |
reader.readAsDataURL(file); | |
reader.onload = function (event) { | |
var dataUrl = event.target.result; | |
var image = new Image(); | |
image.src = dataUrl; | |
image.onload = function () { |
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
import { HTTPFetchNetworkInterface, printAST } from 'apollo-client'; | |
/** | |
* Serialize a object to a query string | |
* @source https://stackoverflow.com/questions/1714786/query-string-encoding-of-a-javascript-object#comment47677757_18116302 | |
*/ | |
function serialize( obj ) { | |
return `?` + Object.keys(obj).map(k => k + `=` + encodeURIComponent(obj[k])).join(`&`); | |
} |
Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.
I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
In the default React Native app scaffolding you have to edit AppDelegate.m
to change where it loads the code if you want to test on your device. I use the following snippet to detect if it's being compiled for Debug or Production and for the Simulator or a device. For Production it uses a copy of the code included in the bundle, for Debug on the simualtor it loads from a server on localhost and for Debug on a device it loads from a server on a given IP address.
NOTE: You need to edit YOUR-IP-HERE and change it to the IP to load the code from when in Debug mode on a device. You could use a service like ngrok to make this work from anywhere.
NSURL *jsCodeLocation;
// Loading JavaScript code
#if DEBUG
// For Debug build load from development server. Start the server from the repository root:
<div class="container"> | |
<form> | |
<h1>Sign-Up Now</h1> | |
<div class="field"> | |
<label for="firstName">First Name</label> | |
<input type="text" id="firstName" name="firstNameTextField" placeholder="First Name"> | |
</div> | |
<div class="field"> | |
<label for="lastName">Last Name</label> | |
<input type="text" id="lastName" name="lastNameTextField" placeholder="Last Name"> |