Skip to content

Instantly share code, notes, and snippets.

View kargaranamir's full-sized avatar
🕸️
Focusing

Amir Hossein Kargaran kargaranamir

🕸️
Focusing
View GitHub Profile
@michaelsaxon
michaelsaxon / 0_How to make a teaser figure for ACL.md
Last active April 20, 2025 10:49
Teaser figures in ACL template papers

Suppose you want to put a full-width figure at the top of your ACL paper, as seen in the example below.

The \figure*{} macro does not work to insert a full-width figure above the abstract in the ACL template for some reason. Thus, we need to hack together a command that does it for us.

This command does a few things:

  • Breaks out of the document rendering defined by the ACL template with strip
  • Manually implements a hacked Figure macro with manually-written "Figure 1:", manual font size setting, etc.
  • Manually sets the figure count variable to not duplicate "Figure 1"
@dbilanoski
dbilanoski / windows11-ms-settings-uri-commands.csv
Last active June 30, 2025 09:54
Complete List Of Windows 11 MS-Settings URI Commands
Category Settings Page URI Command
Accounts Access work or school ms-settings:workplace
Accounts Email & app accounts ms-settings:emailandaccounts
Accounts Family & other people ms-settings:otherusers
Accounts Set up a kiosk ms-settings:assignedaccess
Accounts Sign-in options ms-settings:signinoptions
Accounts Sync your settings ms-settings:sync
Accounts Windows Hello setup ms-settings:signinoptions-launchfaceenrollment
Accounts Your info ms-settings:yourinfo
Apps Apps & Features ms-settings:appsfeatures
@dbilanoski
dbilanoski / windows11-shell-folders-by-clsid.csv
Last active June 30, 2025 09:56
Complete List Of Windows 11 Shell Folders By CLSID GUIDs
Name Shell Command Shortcut
%UserProfile% explorer "shell:::{59031a47-3f72-44a7-89c5-5595fe6b30ee}"
%UserProfile%\Desktop explorer "shell:::{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}"
%UserProfile%\Documents explorer "shell:::{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}"
%UserProfile%\Downloads explorer "shell:::{088e3905-0323-4b02-9826-5d99428e115f}"
%UserProfile%\Pictures explorer "shell:::{24ad3ad4-a569-4530-98e1-ab02f9417aa8}"
Add Network Location explorer "shell:::{D4480A50-BA28-11d1-8E75-00C04FA31A86}"
Additional Information explorer "shell:::{C58C4893-3BE0-4B45-ABB5-A63E4B8C8651}\resultPage"
Advanced Problem Reporting Settings explorer "shell:::{BB64F8A7-BEE7-4E1A-AB8D-7D8273F7FDB6}\pageAdvSettings"
Advanced sharing settings explorer "shell:::{8E908FC9-BECC-40f6-915B-F4CA0E70D03D}\Advanced"
@dbilanoski
dbilanoski / windows11-shell-folders-by-name.csv
Last active June 30, 2025 09:57
Complete List Of Windows 11 Shell Folders By Name
Name Shell Command Shortcut
3D Objects explorer "shell:3D Objects"
AccountPictures explorer "shell:AccountPictures"
AddNewProgramsFolder explorer "shell:AddNewProgramsFolder"
Administrative Tools explorer "shell:Administrative Tools"
AppData explorer "shell:AppData"
AppDataDesktop explorer "shell:AppDataDesktop"
AppDataDocuments explorer "shell:AppDataDocuments"
AppDataFavorites explorer "shell:AppDataFavorites"
AppDataProgramData explorer "shell:AppDataProgramData"
@Helw150
Helw150 / parallel_t5.py
Last active May 10, 2023 14:52
Flan T5 Parallel Usage
from transformers import AutoTokenizer, T5ForConditionalGeneration
# Model Init
n_gpu = 8
tokenizer = AutoTokenizer.from_pretrained("google/flan-ul2")
model = T5ForConditionalGeneration.from_pretrained("google/flan-ul2")
heads_per_gpu = len(model.encoder.block) // n_gpu
device_map = {
gpu: list(
range(
<body onload="brython()">
<h1>Get a joke</h1>
<button id="joke-btn">Get Joke</button>
<div id="joke" class="card">Click the "get joke" button</div>
<!-- Ajax call -->
<script type="text/python" id="script3">
from browser import document, ajax
@generall
generall / shrink_embeddings.ipynb
Created April 27, 2019 22:32
Shrinking Fasttext embeddings
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oscarknagg
oscarknagg / projected_gradient_descent.py
Last active November 25, 2023 03:52
Gist for projected gradient descent adversarial attack using PyTorch
import torch
def projected_gradient_descent(model, x, y, loss_fn, num_steps, step_size, step_norm, eps, eps_norm,
clamp=(0,1), y_target=None):
"""Performs the projected gradient descent attack on a batch of images."""
x_adv = x.clone().detach().requires_grad_(True).to(x.device)
targeted = y_target is not None
num_channels = x.shape[1]
for i in range(num_steps):
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A