Skip to content

Instantly share code, notes, and snippets.

View Marqin's full-sized avatar
🏳️‍🌈

Marqin

🏳️‍🌈
  • London, UK
  • 05:14 (UTC)
View GitHub Profile
DIR=$(mktemp -d)
python -m http.server --bind XXX.XXX.XXX.XXX 8080 &
PID=$!
certbot certonly --webroot $DIR [...]
kill $PID
sleep 0.5
kill -0 $PID && kill -9 $PID
function(get-git-hash _git-hash)
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
set(GIT_HASH "NO_GIT_COMMIT_HASH_DEFINED")
@Marqin
Marqin / ExportChromePasswords.js
Last active February 26, 2018 17:52 — forked from beaverb1ll/ExportChromePasswords.js
ExportChromePasswords.js
var decryptedRow="";
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
var pl = pm.savedPasswordsList_;
for(i=0;i<model.length;i++){
PasswordManager.requestShowPassword(i);
};
setTimeout(function(){
decryptedRow += '"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"';
for(i=0; i<model.length; i++){
#include <functional>
#include <string>
int foo (int a)
{
return a;
}
void foo (std::string s) {}
@Marqin
Marqin / trivia.cpp
Created April 9, 2018 05:55
What this will print?
#include <iostream>
class A {
public:
void foo(float x) {
std::cout << x << " is a float." << std::endl;
}
};
class B : public A {
//https://isocpp.org/wiki/faq/dtors#memory-pools
#include <iostream>
#include <exception>
#include <map>
#include <stdlib.h>
// 1
class Pool {