Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
andrasguseo / delete-events-before-import.php
Last active October 22, 2020 03:46
Event Aggregator - delete events before import
<?php
/**
* Created by PhpStorm.
* Plugin Name: Berean Baptist Church Calendar Import Fixer
* Description: Forces removal of events no longer represented in the imported calendar.
* Version: 0.0.1
* Author: Steve Dwire for Berean Baptist Church
* Author URI: https://www.berean-baptist.org/
* License: GPLv2
*/
@silveraid
silveraid / CentOS-Docker
Created October 27, 2017 12:09
Creating minimal CentOS docker image from scratch
# Create a folder for our new root structure
$ export centos_root='/centos_image/rootfs'
$ mkdir -p $centos_root
# initialize rpm database
$ rpm --root $centos_root --initdb
# download and install the centos-release package, it contains our repository sources
$ yum reinstall --downloadonly --downloaddir . centos-release
$ rpm --root $centos_root -ivh centos-release*.rpm
$ rpm --root $centos_root --import $centos_root/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# install yum without docs and install only the english language files during the process
@zezba9000
zezba9000 / HTTPServer.cs
Last active March 13, 2023 11:52
HTTP C# server
// Modified from: https://gist.github.com/aksakalli/9191056
using System;
using System.Collections.Generic;
using System.Net;
using System.IO;
using System.Threading;
namespace MyNamespace
{
@wqweto
wqweto / program.cs
Last active August 1, 2023 08:31
Minimal .Net Web Server with Regex Routing in 177 LOC of C#
//
// Poor Man's Web Server with Regex Routing in 177 LOC of C#
//
// This is a simple standalone http server that handles routing with regular expressions
// matching. For each request the router passes capture groups to handlers as a data dictionary.
//
// Router implementation constructs a single composite regex to match request path, based on
// https://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html
//
// One can use `WebServer` and `Router` classes alone, just has to register all custom
@nyanpasu64
nyanpasu64 / 0 Saga of the "Give Me CRX" Virus.md
Last active May 17, 2018 14:44
Saga of the "Give Me CRX" Virus

UPDATE

Adam Carbonell has created a non-malicious extension, called "Get CRX": https://chrome.google.com/webstore/detail/get-crx/dijpllakibenlejkbajahncialkbdkjc

Google has removed the original extension, along with several other extensions with similar malware.

Relavant links:

@joemiller
joemiller / he-dns-update.sh
Last active September 4, 2024 18:46
script for updating dynamic DNS records on he.net (hurricane electric)
#!/bin/bash
#
# Script for updating DNS records on Hurricane Electirc's DNS system (https://dns.he.net).
#
# The record will be updated with the IP address that originates the request.
#
# Usage
# -----
#
# Create config file `/etc/he-dns-update.conf`:
@laptrinhcomvn
laptrinhcomvn / Sublime Text 3 cheating.md
Last active April 16, 2025 16:52
Sublime Text 3 patching

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

Common step after enter run the patch command:

  • After run the commands, start new Sublime Text app, go to Main Menu > Help > Enter License. On the popup type in any text (example "a") and click Use Licence .
@Thermionix
Thermionix / userDefineLang_Groovy.xml
Last active February 3, 2025 16:37
Groovy user defined language for notepad++
<NotepadPlus>
<UserLang name="Groovy" ext="groovy" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">03/* 04*/ 00// 01 02</Keywords>
<Keywords name="Keywords1">abstract break case catch continue default do else extends final finally for if implements instanceof native new private protected public return static switch synchronized throw throws transient try volatile while strictfp package import false null super this true</Keywords>
<Keywords name="Keywords2">as assert def mixin property test using in it</Keywords>
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active January 4, 2025 06:04
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;