Skip to content

Instantly share code, notes, and snippets.

@jaseemabid
jaseemabid / spectre.c
Created January 4, 2018 04:42 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@jaseemabid
jaseemabid / 30-randomize-mac-address.conf
Created December 3, 2017 18:06 — forked from fawkesley/30-randomize-mac-address.conf
MAC address randomization in Ubuntu 17+ (>= 1.4.1): save to /etc/NetworkManager/conf.d/
# /etc/NetworkManager/conf.d/30-randomize-mac-address.conf
# REQUIRES NETWORK MANAGER >= 1.4.1 (Ubuntu Zesty and above)
# Thanks to https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/
# This randomize your MAC address for *new* connections
# Be sure to change your existing (saved) connections in
# /etc/NetworkManager/system-connections/*

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

import logging
import time
logger = logging.getLogger(__name__)
def useful():
logger.debug('Hello from webapplib!')
time.sleep(0.01)
;;; auto-remove.el --- Auto remove unused functions in python
;;; Commentary:
;; Uses external tool autoflake to remove unused imports from a Python file.
;;; Code:
(defcustom python-autoflake-path (executable-find "autoflake")
"Autoflake executable path.
#!/usr/bin/env ruby
require "nokogiri"
require "open-uri"
def download(url, output_file)
exit unless system("wget -c #{url} --load-cookies=cookies.txt -O #{output_file}")
end
def download_pages
@jaseemabid
jaseemabid / Connect-Websocket.js
Created March 25, 2012 17:21 — forked from netroy/Connect-Websocket.js
Connect with Websockets
var connect = require('connect'),
WebSocketServer = require('websocket').server,
app = connect.createServer();
app.use(connect.static(process.cwd()));
app.use(connect.router(function(app){
app.get("/", function(req, resp) {
resp.write("Hola !");
resp.end();
@jaseemabid
jaseemabid / git tutorials.md
Last active March 24, 2024 00:07 — forked from netroy/git tutorials.md
Awesome git tutorials I am finding here and there
@jaseemabid
jaseemabid / ReadMe.md
Created October 16, 2011 22:16 — forked from netroy/ReadMe.md
Simplest Static Webserver in Node.JS

Just install connect from npm. Run this in a directory that you'll like to serve static content from. To run on a specific port set ENV "StaticPort"