Skip to content

Instantly share code, notes, and snippets.

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

Ricardo Sánchez ricardodsanchez

🏠
Working from home
View GitHub Profile
@richlander
richlander / share-the-love.md
Last active July 20, 2021 16:53
.NET Core 3.0 -- Post Launch Blog Posts

.NET Core 3.0 -- Post Launch Blog Posts

We launched .NET Core 3.0! Go team! The super official blog post covered a lot of features, but none of them at depth. Many people will want to learn more about specific scenarios at features at much greater depth, with more guidance and better code samples.

The following is a list of proposed posts (with descriptive but prelimary titles) for us to write and publish during the rest of 2019.

Note: This tweet also has feedback.

Getting Started

@mathisonian
mathisonian / index.md
Last active March 22, 2023 05:31
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

@ricardodsanchez
ricardodsanchez / consolelog.min.js
Created August 19, 2014 13:16
This script lets you safely use console log in your web application. Some browsers will throw an error when you have console.log("something") if the developer tools/console window are not open. To avoid this JavaScript errors, use the following script which checks for the existence of the console before trying to use it.
window.log = function () { log.history = log.history || []; log.history.push(arguments); if (this.console) { console.log(Array.prototype.slice.call(arguments)) } };
@ricardodsanchez
ricardodsanchez / countries-continents-ISO-3166-codes
Created August 19, 2014 13:15
SQL Script to create tables with country names, continent names and ISO-3166 codes.
/**
* Country names, continent names and ISO-3166 codes.
*/
CREATE TABLE CONTINENTS (
CODE CHAR(2) NOT NULL, --'Continent code',
CONTINENT_NAME VARCHAR(255),
PRIMARY KEY (CODE)
);
-- Grant Access
@ricardodsanchez
ricardodsanchez / Create-Symbolic-Link
Created August 19, 2014 13:13
Create symbolic links in Windows
@ricardodsanchez
ricardodsanchez / WordCount
Last active August 29, 2015 14:00
Count the number of words in a text editor, text box or text area and display total number of words as you type
$('#editor').keyup(function () {
typewatch(function () {
// executed only 500 ms after the last keyup event.
var words = $('#editor').html().toString().split(' ');
// get number of words
// add the value of words.length to a label, or other html element for displaying purposes as shown below
$('.word-count').text(words.length);
}, 500);
});