(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.
(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.
<?php | |
# Fill our vars and run on cli | |
# $ php -f db-connect-test.php | |
$dbname = 'name'; | |
$dbuser = 'user'; | |
$dbpass = 'pass'; | |
$dbhost = 'host'; | |
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); |
Scenario: You deployed a Heroku project that contains sensitive data (password, API key, etc) but you want to share it on Github.
Problem: You need to commit all files necessary for the application to run on Heroku. However, pushing this to Github would reveal the sensitive info.
Solution: Have a production branch (for this example, master will be the production branch) and a Github branch. The latter contains a different .gitignore that ignores the sensitive files.
import java.io.BufferedOutputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.security.KeyManagementException; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.security.Security; | |
import java.security.cert.CertificateException; | |
import java.security.cert.X509Certificate; |
Press minus + shift + s
and return
to chop/fold long lines!
/* | |
Computes greatest common divisor of two numbers. | |
*/ | |
#include <stdio.h> | |
// function prototype | |
int gcd (int a, int b); |
git remote add github [EMAIL PROTECTED]:myaccount/myapp.git | |
git remote add heroku [EMAIL PROTECTED]:myapp.git | |
Then you can do “git push heroku” and “git push github”, or pull, or | |
From: http://blog.mindtonic.net/using-github-and-heroku-together |
# encoding=utf-8 | |
# Obtener el dígito verificador del RUT en Python. | |
# | |
# La función recibe el RUT como un entero, | |
# y entrega el dígito verificador como un entero. | |
# Si el resultado es 10, el RUT es "raya k". | |
from itertools import cycle |