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
#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 / 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 <vector>
#include <cmath>
using namespace std;
bool esPrimo(int numero)
{
int res=false;
int divs=2;
int mitad;
@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;
@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 / .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 / key_sha1_android
Last active August 29, 2015 14:20
Keytool Android SHA1 - Google Maps v2
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
@codepainkiller
codepainkiller / Game.java
Created April 18, 2015 18:45
Game Loop - Java 2D
package me.martincruz.main;
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Dimension;
import java.awt.Graphics;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
@codepainkiller
codepainkiller / deploy_l5_heroku
Last active April 21, 2018 08:45
Laravel 5 - Deploy to Heroku
Laravel 5 - Deploy to Heroku
Martin Cruz Otiniano
> composer create-project laravel/laravel my_name_app
> cd my_name_app
> git init
> git add -A
> git commit -m "Initial commit"
/*
* UBIGEO - Perú
*/
CREATE TABLE IF NOT EXISTS `departamentos` (
`IdDepartamento` int(11) NOT NULL AUTO_INCREMENT,
`Departamento` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`IdDepartamento`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ;