create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
//Get the instance of TelephonyManager | |
final TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); | |
try { | |
if (tm != null) { | |
Class telephonyManagerClass = Class.forName(tm.getClass().getName()); | |
if (telephonyManagerClass != null) { | |
Method getITelephony = telephonyManagerClass.getDeclaredMethod("getITelephony"); |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
#!/bin/bash | |
# Sign a file with a private key using OpenSSL | |
# Encode the signature in Base64 format | |
# | |
# Usage: sign <file> <private_key> | |
# | |
# NOTE: to generate a public/private key use the following commands: | |
# | |
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048 | |
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem |
select | |
first_name, | |
last_name | |
from | |
users | |
left join | |
companies on companies.id = users.company_id | |
where ( | |
companies.name like 'TERM%' or | |
first_name like 'TERM%' or |
https://www.youtube.com/watch?v=LNIvugvmCyQ
This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)
The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array
it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array
part of it away. So how does that work?
The key here is that objects usually have a predefined set of keys, whereas arrays don't:
<?php | |
namespace Fry; | |
use JsonStreamingParser\Listener; | |
/** | |
* This implementation allows to process an object at a specific level | |
* when it has been fully parsed | |
*/ | |
class ObjectListener implements Listener | |
{ |
Because Travis CI can automatically execute scripts after successfully (or unsuccessfully!) executing tests, it is an obvious choice for a deployment tool. In order to deploy to a Git repository on a remote server, the process generally is as follows:
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
# Ubuntu 18.04 dev Server | |
# Run like - bash install_lamp.sh | |
# Script should auto terminate on errors | |
echo -e "\e[96m Adding PPA \e[39m" | |
sudo add-apt-repository -y ppa:ondrej/apache2 |
// Common Route Patterns http://laravel-tricks.com/tricks/routing-patterns | |
// Patterns | |
Route::pattern('id', '\d+'); | |
Route::pattern('hash', '[a-z0-9]+'); | |
Route::pattern('hex', '[a-f0-9]+'); | |
Route::pattern('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'); | |
Route::pattern('base', '[a-zA-Z0-9]+'); | |
Route::pattern('slug', '[a-z0-9-]+'); | |
Route::pattern('username', '[a-z0-9_-]{3,16}'); |