Skip to content

Instantly share code, notes, and snippets.

View fmoliveira's full-sized avatar

Filipe Oliveira fmoliveira

  • Level Access
  • Toronto
  • 07:48 (UTC -04:00)
View GitHub Profile
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<table class="table-fixed-header">
<thead class="header">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
@fmoliveira
fmoliveira / home.jade
Last active August 29, 2015 14:11 — forked from nolim1t/home.jade
h2 Hello World
h3 Hello World
:markdown
This is some **test** markdown text
we can even link to [stuff](http://google.com)
ul.list
- each i in data
li=i.name
*node_modules/
.DS_Store
if (req.method === 'OPTIONS') {
console.log('!OPTIONS');
var headers = {};
// IE8 does not allow domains to be specified, just the *
// headers["Access-Control-Allow-Origin"] = req.headers.origin;
headers["Access-Control-Allow-Origin"] = "*";
headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, OPTIONS";
headers["Access-Control-Allow-Credentials"] = false;
headers["Access-Control-Max-Age"] = '86400'; // 24 hours
headers["Access-Control-Allow-Headers"] = "X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept";
{?cond}
cond is true
{:else}
cond is not true
{/cond}
{^cond}
cond is false
{:else}
cond is not false
@fmoliveira
fmoliveira / Program.cs
Last active June 17, 2021 10:49
Exports RSA key pair to PEM format.
using System;
using System.Security.Cryptography;
namespace SomeProgram
{
static class Program
{
static void Main()
{
using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(KEY_SIZE))
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@fmoliveira
fmoliveira / dnsproxy.py
Created June 13, 2015 09:18
DNS Proxy with wildcards support written in Python - Original source from: https://code.google.com/p/marlon-tools/source/browse/tools/dnsproxy/dnsproxy.py
#!/usr/bin/env python
# coding: utf-8
from SocketServer import BaseRequestHandler, ThreadingUDPServer
from cStringIO import StringIO
import os
import socket
import struct
import time
'''