Skip to content

Instantly share code, notes, and snippets.

View myfreeer's full-sized avatar
💭
I may be slow to respond.

myfreeer

💭
I may be slow to respond.
View GitHub Profile
@aras-p
aras-p / preprocessor_fun.h
Last active May 23, 2024 08:26
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@myfreeer
myfreeer / URLSearchParams.js
Last active April 28, 2018 03:19
URLSearchParams polyfill in es6, licensed MIT
class URLSearchParams {
constructor(str) {
if (str) this._parse(str);
}
_getStr(key) {
return Array.isArray(this[key]) ? this[key].map(value => `${key}=${encodeURIComponent(value)}`).join('&') : `${key}=${encodeURIComponent(this[key])}`;
}
_parse(str) {
git config --global http.proxy http://127.0.0.1:8087
git config --global https.proxy http://127.0.0.1:8087
git config --global --unset http.proxy
git config --global --unset https.proxy
set_proxy() {
git config http.proxy 127.0.0.1:8087
git config https.proxy 127.0.0.1:8087
git config http.sslVerify false
@myfreeer
myfreeer / anotherRestrictRemoval.js
Last active April 12, 2018 12:35
Remove limits on web pages, such as copy, paste, drag, or something else like that, ONLY available in the WebKit dev tools and in FireBug
var myEvents = ["contextmenu", "select", "selectstart", "copy", "cut", "paste", "drag", "dragend", "dragenter", "dragleave", "dragover", "dragstart", "drop"];
if (window.restrictIsFucked) myEvents.push("wheel", "select", "focus", "scroll", "keydown", "keypress", "keyup", "mousedown", "mouseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "mousewheel", "pointercancel", "pointerdown", "pointerenter", "pointerleave", "pointermove", "pointerout", "pointerover");
[...document.getElementsByTagName('*'), document, window]
.map(element => getEventListeners(element))
.map(eventListeners => myEvents
.map(eventName => eventListeners[eventName])
.filter(e => e === 0 || e)
.map(events => [...events].forEach(event => event.remove())));
window.restrictIsFucked = 1;
@myfreeer
myfreeer / .Moved_to_GitHub.md
Last active December 18, 2019 15:36
aria2 build scripts for msys2
@myfreeer
myfreeer / baidu-pan.user.js
Last active April 9, 2022 11:24
modified baidu-pan helper form greasyfork.org/zh-CN/scripts/23635
// ==UserScript==
// @name 百度网盘直接下载助手
// @namespace undefined
// @version 0.9.24
// @description 直接下载百度网盘和百度网盘分享的文件,避免下载文件时调用百度网盘客户端,获取网盘文件的直接下载地址
// @author ivesjay
// @downloadURL https://gist.github.com/myfreeer/1106826093c401d5276bd35247a1465b/raw/baidu-pan.user.js
// @match *://pan.baidu.com/disk/home*
// @match *://yun.baidu.com/disk/home*
// @match *://pan.baidu.com/s/*
let arr = `112.80.248.52
27.221.40.46
119.75.219.40
111.13.12.44
111.13.12.22
111.13.100.27
117.185.16.83
117.185.16.84
117.185.16.13`.split('\n');
arr = arr.map(url=>'http://'+url);
version: 1.0.{build}
install:
- ps: >-
$gitData = ConvertFrom-StringData (git log -1 --format=format:"commitId=%H%nmessage=%s%ncommitted=%aD" | out-string)
if ($gitData['message'] -eq "") { $gitData['message'] = "No commit message available for $($gitData['commitid'])" }
# View the data with Write-Output @gitData
Update-AppveyorBuild @gitData
@myfreeer
myfreeer / appveyor.yml
Last active May 29, 2017 05:41
Tiny C Compiler build scripts on msys2
version: 1.0.{build}
build_script:
- cmd: >-
C:\msys64\usr\bin\pacman -Syyuu --noconfirm
C:\msys64\usr\bin\pacman -Suu --noconfirm
appveyor DownloadFile https://gist.github.com/myfreeer/c8df0b2acbf97e8b391ca741e5248f3f/raw/tinycc-build.sh
set MSYSTEM=MINGW64