Skip to content

Instantly share code, notes, and snippets.

@LongJohnCoder
LongJohnCoder / crt.cpp
Created March 31, 2018 21:53 — forked from mmozeiko/crt.cpp
MSVC CRT startup
#include <windows.h>
extern "C"
{
#pragma section(".CRT$XIA",long,read)
#pragma section(".CRT$XIZ",long,read)
#pragma section(".CRT$XCA",long,read)
#pragma section(".CRT$XCZ",long,read)
#pragma section(".CRT$XPA",long,read)
#pragma section(".CRT$XPZ",long,read)
@ZipFile
ZipFile / README.md
Last active April 23, 2024 18:48
Pixiv OAuth Flow

Retrieving Auth Token

  1. Run the command:

    python pixiv_auth.py login

    This will open the browser with Pixiv login page.

@emxsys
emxsys / wget_google_drive_download.md
Last active April 23, 2024 18:47
Download Google Drive files with WGET

How to download files from Google Drive with WGET

Step 1. Get the ID of the file to download

  1. Get a shareable link from Google Drive by right-clicking the file and selecting Get Shareable Link.

  2. Examine the link to get the file's ID. Example:

    https://docs.google.com/open?id=[ID]

Step 2. Download the file with WGET

  1. Build the download URL using the ID obtained in Step 1. Example:
[
"1185030898148724777",
"956131521733984287",
"956097947727179806",
"1185045871478448242",
"932096380879667253",
"956246550152118374",
"928549000431407164",
"976786710836944936",
"956128945227567145",
@mudge
mudge / eventemitter.js
Last active April 23, 2024 18:46
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;
@bgusach
bgusach / multireplace.py
Last active April 23, 2024 18:46
Python string multireplacement
def multireplace(string, replacements, ignore_case=False):
"""
Given a string and a replacement map, it returns the replaced string.
:param str string: string to execute replacements on
:param dict replacements: replacement dictionary {value to find: value to replace}
:param bool ignore_case: whether the match should be case insensitive
:rtype: str
"""
@icecr4ck
icecr4ck / idapython_cheatsheet.md
Last active April 23, 2024 18:45
Cheatsheet for IDAPython

progrium/bashstyle

Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:

  • It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
  • It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
  • It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.

This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Frame Limiting Example</title>
</head>
<body>
<canvas id="gameCanvas" width="800" height="600"></canvas>
<script>
@ilukashin
ilukashin / .hooksrc
Last active April 23, 2024 18:43
MacOS zsh terminal notification hooks for long executed operations
# here i am using terminal-notifier
# https://github.com/julienXX/terminal-notifier
# you can use your own solution
# main setting stored in variable
# local execution_treshold=30
# if your process executed more than 30 seconds
# you will get notified