Skip to content

Instantly share code, notes, and snippets.

View jamc92's full-sized avatar
🎯
Focusing

Javier Madrid jamc92

🎯
Focusing
View GitHub Profile
function titleCase(str) {
str = str.toLowerCase();
var split = str.split(' ');
for (var i = 0; i < split.length; i++) {
split[i] = split[i].charAt(0).toUpperCase() + split[i].slice(1);
}
var capitalizeString = split.join(' ');
return capitalizeString;
@jamc92
jamc92 / toUpperCase.js
Last active March 7, 2016 02:40
Uppercase the first letter of each word
function myUpperCase(str) {
split = str.split(' ');
for (var i = 0; i < split.length; i++) {
split[i] = split[i].charAt(0).toUpperCase() + split[i].slice(1);
}
capitalizeString = split.join(' ');
return capitalizeString;
}
@jamc92
jamc92 / findDivisor.js
Last active March 5, 2016 20:28
Find numbers divisibles by 2, 3 y 5
function findDivisor() {
var numbers = [];
var number = 100000;
while (numbers.length < 6) {
for (var i = 0; i < 6; i++) {
if (number % 2 == 0 && number % 3 == 0 && number % 5 == 0){
var divisor = numbers.push(number);
}
@jamc92
jamc92 / gist:37443912e59c3a006ac0
Created January 14, 2016 18:54 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@jamc92
jamc92 / responsiveVideo.html
Created April 26, 2015 04:39
Responsive Video
<div class="video-container">
<iframe width="854" height="510" src="https://www.youtube.com/watch?v=1HBAqiNuFZs" ...>
</div>
@jamc92
jamc92 / nestedBoostrapAccordeon.html
Created April 21, 2015 14:29
Nested Bootstrap Accordeon
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Bootstrap Accordeon</title>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<!-- Latest compiled and minified CSS -->
License Key PhpStorm 8
User Name : EMBRACE
===== LICENSE BEGIN =====
43136-12042010
00002UsvSON704l"dILe1PVx3y4"B3
49AU6oSDJrsjE8nMOQh"8HTDJHIUUh
gd1BebYc5U"6OxDbVsALB4Eb10PW8"
===== LICENSE END =====
License Key PhpStorm 8
User Name : EMBRACE
===== LICENSE BEGIN =====
43136-12042010
00002UsvSON704l"dILe1PVx3y4"B3
49AU6oSDJrsjE8nMOQh"8HTDJHIUUh
gd1BebYc5U"6OxDbVsALB4Eb10PW8"
===== LICENSE END =====
@jamc92
jamc92 / callingFlickr.js
Created March 15, 2015 19:45
jSON - Using jSON with Flickr
// Calling our function with a parameter as ID
function loadFlickr(flickrId) {
//Display a loading icon in our display element
$('#feed').html('<span><img src="/blog/images/lightbox-ico-loading.gif" alt=""></span>');
// Request the JSON and process it
$.ajax({
type:'GET',
url:"http://api.flickr.com/services/feeds/photos_public.gne",
data:"id"+flickrId+"&lang=en-us&format=json&jsoncallback=?",
@jamc92
jamc92 / prototypeInheritance.html
Created March 15, 2015 19:43
JS - Inheritance with prototype
<!DOCTYPE html>
<html>
<head>
<title>Prototype Inheritance</title>
<script type="text/javascript">
function Domestico() {
this.animal = "";
this.nombre= "";
this.configurarAnimal = function(nuevoAnimal) {