Skip to content

Instantly share code, notes, and snippets.

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

BrunoLM brunolm

🏠
Working from home
View GitHub Profile
@brunolm
brunolm / README.md
Created June 24, 2016 17:00
Visual Studio Code Extensions
@brunolm
brunolm / script.js
Last active February 15, 2018 14:33
Export wordpress posts to bash echos in jekyll format
// first inject jQuery on the page, then run on /wp-admin/edit.php
// wait for it then run o.join('\n')
// execute the output on _posts folder
var o = [];
(function() {
let posts = [].slice.call(document.querySelectorAll('.post_name')).map(e => {
let container = e.parentNode;
let id = container.id.split('_')[1];
let editUrl = `https://your.wordpress.com/wp-admin/post.php?post=${id}&action=edit`;
curl -L "https://go.microsoft.com/fwlink/?LinkID=760868" > /tmp/vscode.deb
sudo dpkg -i /tmp/vscode.deb && sudo apt-get install -f
@brunolm
brunolm / UnitTest.ts
Created July 18, 2013 18:53
Class to do Unit Test with TypeScript and TSTestAdapter
class Assert
{
public static AreEqual<T>(expected: T, actual: T, message: string = ""): void
{
if (expected !== actual)
{
throw "Assert.AreEqual failed. "
+ "Expected: <" + expected + ">. "
+ "Actual: <" + actual + ">. "
+ message;
@brunolm
brunolm / example.js
Created April 3, 2011 00:33
Uri object similar to .NET Uri
var www = new Uri("http://www.stackoverflow.com:80/path/sub.aspx?query=11#!/path2?query2=2");
var t = [];
for (var i in www)
{
t.push(i + " " + www[i]);
}
alert(t.join("\n"));