(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Connect to your Mac's localhost from within a VMWare virtual machine. | |
- Boot up VMware and fire up your VM (i'm using Windows 7) | |
- Make sure that the VM is using NAT | |
- Fire up the command prompt in Windows and type "ipconfig". IN the resulting text look for your IPv4 address. It will be something like 192.168.xxx.xxx | |
- Now go to your browser in your VM and type that ip address into the url bar but change the last set of digits to be 2 (or 1). | |
- so as an example if your ip was found to be 192.168.213.200 change it to be 192.168.213.2 | |
- Assuming that your localhost is running on your mac you should get your localhost in your VM browser. | |
- If you need to add a non standard port number on the end like 8090 go ahead and do so. |
the easiest way to use multiple constructors: | |
<?php | |
class A | |
{ | |
function __construct() | |
{ | |
$a = func_get_args(); | |
$i = func_num_args(); | |
if (method_exists($this,$f='__construct'.$i)) { |
class MyAdmin(admin.ModelAdmin): | |
list_display = (..., 'actions_html') | |
def actions_html(self, obj): | |
return format_html('<button class="btn" type="button" onclick="activate_and_send_email({pk})">Activate and send email</button>', pk=obj.pk) | |
actions_html.allow_tags = True | |
actions_html.short_description = "Actions" |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# the IP(s) on which your node server is running. I chose port 3000. | |
upstream app_geoforce { | |
server 127.0.0.1:3000; | |
} | |
upstream app_pcodes{ | |
server 127.0.0.1:3001; | |
} |
This script is intended to automatically fix the sequence numbers for all tables in the current database.
This is accomplished through the use of the setval()
command, which we provide with the next ID value we wish to make use of.
We use the setval(sequence, number, is_called)
overload
and set is_called = false
in conjunction with COALESCE(MAX + 1, 1)
to ensure that, with an empty table, the next sequence
value is 1
as expected.
Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.
/etc/ssh/sshd_config
file by running the command sudo vi /etc/ssh/sshd_config
and do the following
Port
to 2222 (or any other port above 1000)PasswordAuthentication
to yes. This can be changed back to no if ssh keys are setup.sudo service ssh --full-restart
Docker image to Virtualbox disk
https://stackoverflow.com/questions/23436613/how-can-i-convert-a-docker-image-into-a-vagrant-virtualbox-box by user blueskin (CC by-sa 3.0)
Find the size of the docker image from docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
📱 Google Nexus One - 2.3.7 - API 10 - 480x800 261.9 MB
📱 Google Nexus S - 2.3.7 - API 10 - 480x800 261.9 MB