Skip to content

Instantly share code, notes, and snippets.

View Yushell's full-sized avatar

Yushell Darwich Yushell

View GitHub Profile
@Yushell
Yushell / ArrayPrototype.js
Last active December 22, 2015 19:29
Extend JavaScript array to find and remove contained values
/*
Usage example:
-- array.contains(1)
Description: Checks if array contains value 1
Demo: http://jsfiddle.net/Yushell/GTSXh/
*/
Array.prototype.contains = function(obj) {
var i = this.length;
while (i--) {
@Yushell
Yushell / GetDateNowSpanish.cs
Created September 10, 2013 21:23
Get DateTime.Now Day, Month, Year in Spanish & different formats
CultureInfo ci = new CultureInfo("es-ES");
// 29
string vDia = Convert.ToString(DateTime.Now.Day);
// AGO
string vMes = Convert.ToString(DateTime.Now.ToString("MMMM", ci).ToUpper().Substring(0, 3));
// 2012
string vAnio = Convert.ToString(DateTime.Now.Year);
// 08
string vMesNumero = Convert.ToString(DateTime.Now.ToString("MM"));