Skip to content

Instantly share code, notes, and snippets.

View mayocream's full-sized avatar
我が名はめぐみん。紅魔族随一の魔法の使い手にして、爆裂魔法を操りし者。我が力、見るがいい!エクスプロージョン!

Mayo mayocream

我が名はめぐみん。紅魔族随一の魔法の使い手にして、爆裂魔法を操りし者。我が力、見るがいい!エクスプロージョン!
View GitHub Profile
@frkd-dev
frkd-dev / time_perf.c
Last active April 13, 2022 08:53
Measure performance for different time functions
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <sys/time.h>
/*
Build:
gcc -o time_perf time_perf.c
@webframp
webframp / keybase.md
Created July 25, 2017 18:14
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@mdonkers
mdonkers / server.py
Last active May 31, 2024 02:22
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@davydany
davydany / IPTABLES-CHEATSHEET.md
Last active May 27, 2024 14:55
IP Tables (iptables) Cheat Sheet

IP Tables (iptables) Cheat Sheet

IPTables is the Firewall service that is available in a lot of different Linux Distributions. While modifiying it might seem daunting at first, this Cheat Sheet should be able to show you just how easy it is to use and how quickly you can be on your way mucking around with your firewall.

Resources

The following list is a great set of documentation for iptables. I used them to compile this documentation.

@zmmbreeze
zmmbreeze / analytics.js
Last active April 23, 2024 02:14
GA的源码 analytics.js
(function() {
/**
* 记录方法使用情况的类
* @param {Array.<boolean>} umMap 初始的使用情况
*/
var UsageManager = function(umMap) {
this.umMap = umMap || [];
};
/**
* 记录新的使用情况
@adeekshith
adeekshith / .git-commit-template.txt
Last active February 21, 2024 12:06 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@starwing
starwing / timer.lua
Created November 18, 2015 08:56
A pure Lua timer implement for LuaJIT
local sleep, get_time
local math_floor = math.floor
if not jit then -- not LuaJIT?
return require "timer.c"
elseif jit.os == "Windows" then
local ffi = require "ffi"
ffi.cdef [[
void __stdcall Sleep(unsigned dwMilliseconds);
unsigned __stdcall GetTickCount(void);
@gokulkrishh
gokulkrishh / media-query.css
Last active June 1, 2024 03:01
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@Manouchehri
Manouchehri / cloudflare.sh
Last active May 29, 2024 22:11
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule