Skip to content

Instantly share code, notes, and snippets.

@weslleih
weslleih / date.extensions.ts
Last active November 11, 2023 08:00
Extend the TypeScript Date Object with some useful methods
export {}
declare global {
interface Date {
addDays(days: number, useThis?: boolean): Date;
isToday(): boolean;
clone(): Date;
isAnotherMonth(date: Date): boolean;
isWeekend(): boolean;
isSameDate(date: Date): boolean;
@weslleih
weslleih / gist:4113096
Created November 19, 2012 19:27
A simple Http File Server written in Node.js
var http = require('http');
var fs = require('fs');
var httpserver = http.createServer(onRequest);
httpserver.listen(8124, "127.0.0.1",serverCreated_callback());
function onRequest(request, response){
var pureUrl = request.url;
if (pureUrl == '/favicon.ico')
return;
@weslleih
weslleih / gist:3378987
Created August 17, 2012 14:08
Aptana Studio 3 Gnome launcher
2 – Baixe o programa no site abaixo e descompacte na pasta /opt
http://download.aptana.com/studio3/standalone/3.2.0/linux/Aptana_Studio_3_Setup_Linux_x86_64_3.2.0.zip
3 – Execute o comando abaixo para renomear o arquivo:
$sudo mv Aptana_Studio_3 aptana
@weslleih
weslleih / directions.md
Last active April 4, 2020 15:42
Teamspeak service for Linux

Assuming you have downloaded and unzipped the latest version of the program in folder /opt/ts3

  • Create a user for the application and disable logging

Ubuntu

adduser --disabled-login

Fedora

@weslleih
weslleih / linuxConsoleEmulators.md
Last active May 7, 2020 16:42
List of linux console emulators