Skip to content

Instantly share code, notes, and snippets.

View Daniel15's full-sized avatar
💭
Busy

Daniel Lo Nigro Daniel15

💭
Busy
View GitHub Profile
@adammw
adammw / facebook-anonymiser.js
Last active August 29, 2015 14:06
Remove names from Facebook posts and comments allow them to be screenshotted and posted to internet forums without exposing user identities.
(function() {
var hash = {};
var anonymise = function() {
// Handle links to user profiles, e.g. those shown when someone likes a post
Array.prototype.forEach.call(document.querySelectorAll('[data-hovercard*="user.php"], [data-hovercard*="hovercard.php"]'), function(hovercardLink) {
if (!hovercardLink.dataset.hovercard) return;
var id = /id=(\d+)/.exec(hovercardLink.dataset.hovercard)[1];
var hue = hash[id] = hash[id] || (Math.random() * 360);
hovercardLink.style.background = 'hsl(' + hue + ',55%,60%)';
/**
* Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@prabirshrestha
prabirshrestha / Bootstrapper.cs
Last active March 31, 2018 16:57
Server side reactjs rendering in Nancy with React.NET
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void RequestStartup(TinyIoCContainer container, IPipelines pipelines, NancyContext context)
{
base.RequestStartup(container, pipelines, context);
var react = new ReactEnvironment(
new JavaScriptEngineFactory(),
new ReactSiteConfiguration(),
new NullReactCache(),
@bevacqua
bevacqua / gulp-npm-publish.js
Created January 18, 2014 16:22
Publish packages to `npm` using Gulp.
var spawn = require('child_process').spawn;
gulp.task('npm', function (done) {
spawn('npm', ['publish'], { stdio: 'inherit' }).on('close', done);
});
@iamarcel
iamarcel / Structuring Neat .NET Core Command Line Apps Neatly.org
Created September 7, 2016 07:30
Structuring Neat .NET Core Command Line Apps Neatly
import sys
import extract_icon
import os
import argparse
class MorIcons:
"""
parses an ``APPS.INF`` file, dumps all icons from a PE binary and
generates an HTML file with all the icons and associated program
names
@softworkz
softworkz / ReadMe.md
Last active February 11, 2023 17:22
Generate M3U Playlist for SiliconDust HDHomerun Tuners

SYNOPSIS

Creates an M3U playlist for an HDHomerun tuner

DESCRIPTION

Downloads the lineup from an HDHR tuner, specified by IP address and transforms it into an M3U plalist

When you don't specify an output file, the m3u content will be printed out for preview.
@Daniel15
Daniel15 / _README.md
Last active August 29, 2023 21:33
Routing scripts for Tinc

This Gist contains some scripts for Tinc, in order to configure the routing tables for a remote subnet on Windows (ie. if a remote system wants to expose an entire subnet over the VPN). Tinc does not configure the routing tables by default, which is why these scripts are needed. See the mailing list thread here: https://www.tinc-vpn.org/pipermail/tinc/2018-December/005340.html

Place the files in the Tinc network directory (eg. C:\Program Files\Tinc\netname\) and change $interface in functions.ps1 to match the name of the Tinc interface configured in tinc.conf

@gdvalle
gdvalle / putty-monokai.reg
Created December 2, 2012 05:24
Monokai style theme for PuTTY; colors copied from ST2's theme
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\monokai]
"Colour21"="255,255,255"
"Colour20"="245,222,179"
"Colour19"="200,240,240"
"Colour18"="0,217,217"
"Colour17"="179,146,239"
"Colour16"="174,129,255"
"Colour15"="122,204,218"
@iamarcel
iamarcel / Creating Neat .NET Core Command Line Apps.md
Last active November 28, 2023 10:41
Creating Neat .NET Core Command Line Apps

Creating Neat .NET Core Command Line Apps

You can now read this on my (pretty) website! Check it out here.

Every reason to get more HackerPoints™ is a good one, so today we're going to write a neat command line app in .NET Core! The Common library has a really cool package Microsoft.Extensions.CommandlineUtils to help us parse command line arguments and structure our app, but sadly it's undocumented.

No more! In this guide, we'll explore the package and write a really neat