Skip to content

Instantly share code, notes, and snippets.

@barik
barik / DelphiSwitchToFiber.pas
Created July 28, 2023 18:55 — forked from jsbattig/DelphiSwitchToFiber.pas
Unit to properly SwitchToFiber() in Delphi without breaking exception handling
{
The idea of DelphiSwitchToFiber() function is to backup on a local variable in stack the
state of the Exception stack right before calling SwitchToFiber() and then restoring its state
right atfer returns from call to SwitchToFiber().
If SwitchToFiber() is used directly from within an Except or Finally block, and if there's an exception
raised after switching to another fiber, upon coming back the results will be unpredictable because
the exception stack will be completely unwinded and all raise exceptions destroyed.
In order to prevent this issue we must backup the Exception stack before the call to SwitchToFiber()
and restore it right after the call.
@barik
barik / ijoc_output.csv
Created June 11, 2021 19:04
ijoc_output.csv
We can't make this file beautiful and searchable because it's too large.
issue,title,href
https://ijoc.org/index.php/ijoc/issue/view/17,American Spring: How Russian State Media Translate American Protests for an Arab Audience,https://ijoc.org/index.php/ijoc/article/view/17079/3455
https://ijoc.org/index.php/ijoc/issue/view/17,“One Big Fake News”: Misinformation at the Intersection of User-Based and Legacy Media,https://ijoc.org/index.php/ijoc/article/view/16459/3454
https://ijoc.org/index.php/ijoc/issue/view/17,"Mediatized Realities of Migrants in a Comparative Perspective: Media Use, Deservingness, and Threat Perceptions in the United States and Western Europe",https://ijoc.org/index.php/ijoc/article/view/16437/3453
https://ijoc.org/index.php/ijoc/issue/view/17,Developing a Perceived Social Media Literacy Scale: Evidence from Singapore,https://ijoc.org/index.php/ijoc/article/view/16118/3452
https://ijoc.org/index.php/ijoc/issue/view/17,Perception and Decision Making: A Multi-Technique Analysis of Campaign Posters in the 2019 Bogotá Mayoral Election,https://ijoc.org/index.php/ijoc
@barik
barik / ijoc_scrape.py
Created June 11, 2021 19:04
ijoc_scrape.py
from bs4 import BeautifulSoup
import requests
import csv
output = []
archives = requests.get("https://ijoc.org/index.php/ijoc/issue/archive")
soup = BeautifulSoup(archives.content, features="lxml")
results = soup.div.find_all("div", {"id": "issue"})
import imaplib
HOST = "imap.gmail.com"
USER = "[email protected]"
PASSWORD = "---"
BATCH_FOLDER = "Batch"
INBOX_FOLDER = "\\Inbox"
import io
import yaml
from enum import Enum
def process_yaml_file(f):
pass
class ParseState(Enum):
init = 0,
find_dict = 1
<?xml version="1.0" encoding="UTF-8"?>
<Licenses><License><![CDATA[CPU sockets (Hyper-V)=0
CPU sockets (vSphere)=32
Company=ITSS
Description=Copyright 2016 Veeam, Inc. All Rights Reserved. The Software Product is protected by copyright and other intellectual property laws and treaties. Veeam or its suppliers own the title, copyright, and other intellectual property rights in the Software Product. Veeam reserves all rights not expressly granted to you in EULA. The Software Product is licensed, not sold. Veeam grants to you a nonexclusive nontransferable license to use the Software Product, provided that you agree with EULA.
[email protected]
Edition=Enterprise Plus
Expiration date=26/03/2016
First name=Michael
Last name=Everett
<?xml version="1.0" encoding="UTF-8"?>
<Licenses><License><![CDATA[CPU sockets (Hyper-V)=0
CPU sockets (vSphere)=32
Company=ITSS
Description=Copyright 2016 Veeam, Inc. All Rights Reserved. The Software Product is protected by copyright and other intellectual property laws and treaties. Veeam or its suppliers own the title, copyright, and other intellectual property rights in the Software Product. Veeam reserves all rights not expressly granted to you in EULA. The Software Product is licensed, not sold. Veeam grants to you a nonexclusive nontransferable license to use the Software Product, provided that you agree with EULA.
[email protected]
Edition=Enterprise Plus
Expiration date=13/02/2016
First name=Titus
Last name=Barik
USAGE: scan-build [options] <build command> [build options]
OPTIONS:
-analyze-headers
Also analyze functions in #included files. By default, such functions
are skipped unless they are called by functions within the main source file.
-o <output location>
@barik
barik / gist:1f6f4c7a505d6c29e080
Created December 31, 2015 03:20 — forked from mrtimp/gist:6987519
Cisco IOS IPsec/L2TP VPN
!
aaa new-model
!
!
aaa authentication login VPN local
aaa authorization network VPN local
!
!
vpdn enable
!
import imaplib
HOST = "mail.messagingengine.com"
USER = "[email protected]"
PASSWORD = "password"
BATCH_FOLDER = "INBOX.Batch"
INBOX_FOLDER = "INBOX"