Skip to content

Instantly share code, notes, and snippets.

View rurtubia's full-sized avatar

Randy Urtubia rurtubia

View GitHub Profile

Instalación según tutorial Symfony2 + AngularJS3

1) Introducción y Bienvenida

2) Preparar el entorno de desarrollo

2.1) Instalar Wamp server

Antes de esto, instalar librerías redistributable by Microsoft

//Generar los campos en las entidades
//Actualizar la BD
php app/console doctrine:schema:update --force
//Genera o actualiza las entidades php en AppBundle/Entity, genera los getters & setters dependiendo de los campos existentes en la entidad
php app/console doctrine:generate:entities AppBundle
//En la carpeta Form
//En EmployeeType.php, se agregan campos
@rurtubia
rurtubia / TruncateAString.js
Last active December 20, 2015 06:01
My solution to FreeCodeCamp bonfire 11 Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a "..." ending. Note that the three dots at the end add to the string length. If the num is less than or equal to 3, then the length of the three dots is not added to t…
function truncate(str, num) {
// Clear out that junk in your trunk
//If the num is less than or equal to 3, then the length of the three dots is not added to the string length.
if (num <= 3)
return str.slice(str, num) + "...";
//Truncate a string if it is longer than the given maximum string length
else if(str.length > num)
return str.slice(str, num-3) + "...";
else if (str.length <= num)
@rurtubia
rurtubia / repeatAString.js
Created December 20, 2015 05:29
My solution to bonfire 10 at FreeCodeCamp Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number.
function repeat(str, num) {
// repeat after me
//return str;
var array = [];
for(i=0 ; i < num; i++)
{
array.push(str);
}
@rurtubia
rurtubia / confirmEnding.js
Created December 19, 2015 15:45
My solution to the 9th bonfire at FreeCodeCamp
function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
//obtain the number of characters from str that will be compared
subLength = target.length;
//gets the substring from the end of str
//'-' operator is used to get a substring from the end of the original string
sub = str.substr(-subLength);
@rurtubia
rurtubia / titleCaseSentence.js
Created December 19, 2015 14:56
My solution to FreeCodeCamp bonfire 6: Title Case a Sentence
function titleCase(str) {
//split the string into an array of strings
var tempArray = str.split(' ');
//for each string in the array...
for(var i=0;i<tempArray.length;i++)
{
//change all words to lower case
tempArray[i] = tempArray[i].toLowerCase();
@rurtubia
rurtubia / longestWordInString.js
Created December 19, 2015 12:22
My solution to the fifth bonfire at FreeCodeCamp Return the length of the longest word in the provided sentence. Your response should be a number.
function findLongestWord(str) {
//Splits the string into an array
var countArray = str.split(' ');
//int variable to store the longest character count.
var max = 0;
//loops through the array
//countArray.length obtains the number of elements in the array
@rurtubia
rurtubia / palindromeChecker.js
Created December 19, 2015 11:47
My solution to FreeCodeCamp bonfire number 4
function palindrome(str) {
//converts everything to lower case
str = str.toLowerCase();
//eliminates spaces from string
str = str.replace(/ /g,'');
//removes: '/', '_', '\', '(', ')', '.', ',', '-' from the string
//'-' must be declared at the end of the string
@rurtubia
rurtubia / Instalación ftp
Last active December 8, 2015 01:15
Instalación de Servicios Web
_
@rurtubia
rurtubia / GUI_to_CLI.md
Last active November 24, 2015 00:20
Making a GUI Linux installation boot as CLI

##GUI to CLI single boot.

When you are at the GRUB menu where you select which OS to boot (if this menu don’t appear, press ESC while you get the “Booting CentOS in X seconds”), press e to edit your boot commands. You should see a screen like this: (parameters may vary)

##GUI to CLI permanent boot.

Look for the line that begins with kernel. Choose it and then press e again. You will be at a simple editor, add 3 to the end of this line. This means booting in runlevel 3, which is text-mode only.