Skip to content

Instantly share code, notes, and snippets.

View codepainkiller's full-sized avatar
🏠
Working from home

Martin Cruz codepainkiller

🏠
Working from home
View GitHub Profile
@codepainkiller
codepainkiller / .gitignore
Last active August 29, 2015 14:25 — forked from sharno/.gitignore
Java servlet/JSP project .gitignore file
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
@codepainkiller
codepainkiller / grub_install
Last active September 6, 2015 22:14
Instalar/Recuperar GRUB
# Desde un Live CD de Linux, acceder como super usuario
> sudo su
# Listar partciones de disco duro
> fdisk -l
# Montar la partición
> mount /dev/sda[numero_particion] /mnt/
# Instalar grub
@codepainkiller
codepainkiller / random_accumuator.cpp
Created August 31, 2015 17:34
Random Accumulator
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int randomAccumulator()
{
int suma = 0;
int randNumber = 0;
int temp = 0;
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
bool esPrimo(int numero)
{
int res=false;
int divs=2;
int mitad;
@codepainkiller
codepainkiller / 20th_capicua.cpp
Created August 31, 2015 18:17
20vo numero capicua
#include <iostream>
using namespace std;
bool isCapicua(int num)
{
int a = num;
int c = 0;
int b = 0;
while(a != 0)
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
string kilobases()
{
float kb = 0.03;
float gc = 0.5;
int longitud = kb * 1000;
@codepainkiller
codepainkiller / config
Created September 6, 2015 04:58
Config Host SSH - GitHub / BitBucket
Host github.com
Hostname ssh.github.com
Port 443
Host bitbucket.org
Hostname altssh.bitbucket.org
Port 443
@codepainkiller
codepainkiller / gits
Last active April 26, 2016 21:00
Comandos Git
# Revert merge
git reset --merge ORIG_HEAD
#
git branch --set-upstream-to=origin/<padre> <hijo>
git branch --set-upstream-to=origin/sprint_1 EP-611-cambio-de-paquetes-a-mostrar
$.ajax({
url: 'http://mydomain.com/ajax-request',
type: 'POST',
dataType: 'json',
async: true,
data:{
'_token': '{{ csrf_token() }}',
'foo' : 'Foo'
},
success: function success(data, status) {
@codepainkiller
codepainkiller / .bashrc
Last active March 18, 2017 00:40
Show branch Git - Bash
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0m\]"
PS1="$GREEN\u@\h$NO_COLOR:\w$YELLOW\$(parse_git_branch)$NO_COLOR\$ "