Skip to content

Instantly share code, notes, and snippets.

View ahmed-shariff's full-sized avatar
👓
Having fun working

Ahmed Shariff ahmed-shariff

👓
Having fun working
View GitHub Profile
@ahmed-shariff
ahmed-shariff / symlinkToSamples.ps1
Created April 27, 2024 00:34
ps script to symlink Samples~ folder to Samples to allow editing
# To modify the sampels, create a symlink of the Samples~ directory
New-Item -ItemType SymbolicLink -Path ../Samples -Target ../Samples~
local Players = game:GetService("Players")
local projectileBase = script.Parent.projectile
local prompt = script.Parent.ProximityPrompt
prompt.Triggered:Connect(function (player)
shootProjectile(30, 0.95, 2, 10)
end)
-- example call: shootProjectile(30, 0.95, 2, 10)
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
@ahmed-shariff
ahmed-shariff / main.tex
Last active February 22, 2024 06:45
Generate bib file from master file locally, use local bib on overleaf
% Close to the end of main tex file, have this:
% from https://tex.stackexchange.com/questions/596258/automatic-detection-of-overleaf-for-fallback-images/598669#598669
\ifnum\pdfstrcmp{\jobname}{output}=0
\bibliography{bibliography.bib}
\else
% wherever the master bib file is
\bibliography{\string~/Documents/org/bibliography/references.bib}
\fi
@ahmed-shariff
ahmed-shariff / org-agenda-bulk-custom-functions.el
Created May 19, 2022 21:24 — forked from dive/org-agenda-bulk-custom-functions.el
org-mode: org-agenda-bulk-custom-functions
(defun dive/org-mark-as-reviewed ()
"Mark current selected items as REVIEWED."
(org-set-property "REVIEWED" (org-time-stamp '(16) nil)))
(add-to-list 'org-agenda-bulk-custom-functions
'(?R dive/org-mark-as-reviewed))
@ahmed-shariff
ahmed-shariff / DisableTouchConversionToMouse.cs
Created March 14, 2022 14:35 — forked from vbfox/DisableTouchConversionToMouse.cs
Globally disable the conversion of touch events to mouse events in Windows 7
namespace BlackFox
{
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Security;
/// <summary>
/// As long as this object exists all mouse events created from a touch event for legacy support will be disabled.
/// </summary>
[tool.poetry]
name = "test_keyboard"
version = "0.1.0"
description = ""
authors = [""]
[tool.poetry.dependencies]
python = "^3.9"
keyboard = "^0.13.5"
@ahmed-shariff
ahmed-shariff / pywin32_pygame_transparent_clickthrough.py
Last active May 17, 2021 09:32
make pygame window and passthrough events by making the window always on top and transparent using pywin32
# from: https://www.generacodice.com/en/articolo/197402/Fully-transparent-windows-in-Pygamea=r
# and: https://stackoverflow.com/questions/25381589/pygame-set-window-on-top-without-changing-its-position
# Also: https://stackoverflow.com/questions/29458775/tkinter-see-through-window-not-affected-by-mouse-clicks/29854420#29854420
# https://stackoverflow.com/questions/29091028/windows-api-write-to-screen-as-on-screen-display
import pygame
import win32api
import win32con
import win32gui
import pygame
# no sound: http://superuser.com/questions/268985/ddg#268986
ffmpeg -i example.mkv -c copy -an example-nosound.mkv
# concat video: https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg
ffmpeg -i input1.mp3 -i input2.mp3 -i input3.mp3 \
-filter_complex "concat=n=3:v=0:a=1" -f MOV -vn -y input.m4a
# concat means use the media concatenate (joining) function.
# n means confirm total count of input files.
# v means has video? use 0 = no video, 1 = contains video.
# a means has audio? use 0 = no audio, 1 = contain audio.
cmaps = 'Accent', 'Accent_r', 'Blues', 'Blues_r', 'BrBG', 'BrBG_r', 'BuGn', 'BuGn_r', 'BuPu', 'BuPu_r', 'CMRmap', 'CMRmap_r', 'Dark2', 'Dark2_r', 'GnBu', 'GnBu_r', 'Greens', 'Greens_r', 'Greys', 'Greys_r', 'OrRd', 'OrRd_r', 'Oranges', 'Oranges_r', 'PRGn', 'PRGn_r', 'Paired', 'Paired_r', 'Pastel1', 'Pastel1_r', 'Pastel2', 'Pastel2_r', 'PiYG', 'PiYG_r', 'PuBu', 'PuBuGn', 'PuBuGn_r', 'PuBu_r', 'PuOr', 'PuOr_r', 'PuRd', 'PuRd_r', 'Purples', 'Purples_r', 'RdBu', 'RdBu_r', 'RdGy', 'RdGy_r', 'RdPu', 'RdPu_r', 'RdYlBu', 'RdYlBu_r', 'RdYlGn', 'RdYlGn_r', 'Reds', 'Reds_r', 'Set1', 'Set1_r', 'Set2', 'Set2_r', 'Set3', 'Set3_r', 'Spectral', 'Spectral_r', 'Wistia', 'Wistia_r', 'YlGn', 'YlGnBu', 'YlGnBu_r', 'YlGn_r', 'YlOrBr', 'YlOrBr_r', 'YlOrRd', 'YlOrRd_r', 'afmhot', 'afmhot_r', 'autumn', 'autumn_r', 'binary', 'binary_r', 'bone', 'bone_r', 'brg', 'brg_r', 'bwr', 'bwr_r', 'cividis', 'cividis_r', 'cool', 'cool_r', 'coolwarm', 'coolwarm_r', 'copper', 'copper_r', 'crest', 'crest_r', 'cubehelix', 'cubehelix_r', 'flag', 'flag_