Skip to content

Instantly share code, notes, and snippets.

View ffuentese's full-sized avatar
😃
improving PHP and learning Vue

Francisco Fuentes ffuentese

😃
improving PHP and learning Vue
View GitHub Profile
@rbonvall
rbonvall / rut.py
Created July 5, 2010 23:56
Dígito verificador del RUT en Python
# 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
@alterisian
alterisian / heroku_to_github.txt
Created October 28, 2010 13:10
How to git your existing heroku app into a new github repo
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
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@capex
capex / gcd.c
Created October 10, 2012 07:06
GCD in C
/*
Computes greatest common divisor of two numbers.
*/
#include <stdio.h>
// function prototype
int gcd (int a, int b);
@hofmannsven
hofmannsven / README.md
Last active July 16, 2024 01:30
Git CLI Cheatsheet
@sandeepkunkunuru
sandeepkunkunuru / SOAPClient.java
Last active September 5, 2019 09:56
WebService - Document(SOAP) mode invocation - https - Example - from Scratch - Without referencing any library specific or generated classes e.g. classes of axis, axis2, cxf etc.
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;
@jczaplew
jczaplew / herok_github.md
Last active January 11, 2023 10:41
Heroku + Github + Sensitive Data

Heroku + Github + Sensitive Data

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.

@chales
chales / db-connect-test.php
Last active June 3, 2023 01:01
Script for a quick PHP MySQL DB connection test.
<?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'");
@staltz
staltz / introrx.md
Last active July 27, 2024 04:59
The introduction to Reactive Programming you've been missing
<!doctype>
<html>
<head>
</head>
<body>
<?php
require_once "Classes/PHPExcel.php";
$tmpfname = "test.xlsx";