Skip to content

Instantly share code, notes, and snippets.

View ibehnam's full-sized avatar
:dependabot:
prompting ChatGPT

Behnam Moh ibehnam

:dependabot:
prompting ChatGPT
View GitHub Profile
@ibehnam
ibehnam / where-it-all-began.json
Created March 8, 2022 00:14
JSON config for "Where-it-All-Began" map as a Valentine's gift
[
{
"elementType": "geometry.fill",
"stylers": [
{
"color": "#ffffff"
}
]
},
{
@ibehnam
ibehnam / karabiner.edn
Created June 1, 2022 18:39 — forked from kaushikgopal/karabiner.edn
My source Karabiner file in Goku's edn format
{
;; :!Ca is keycode :a and prefix a with !C
;; C | left_command
;; T | left_control
;; O | left_option
;; S | left_shift
;; F | fn
;; Q | right_command
;; W | right_control
@ibehnam
ibehnam / get_title_and_url.applescript
Created June 25, 2022 01:27 — forked from vitorgalvao/Get Title and URL.applescript
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Chromium variants include "Google Chrome", "Chromium", "Opera", "Vivaldi", "Brave Browser", "Microsoft Edge".
-- Specific editions are valid, including "Google Chrome Canary", "Microsoft Edge Dev".
-- "Google Chrome" Example:
tell application "Google Chrome" to return title of active tab of front window
@ibehnam
ibehnam / Spotify's Properties in its SDEF file.xml
Last active July 17, 2022 17:33
Spotify's Properties in its SDEF file
<class name="application" code="capp" description="The Spotify application.">
<access-group identifier="com.spotify.playback"/>
<cocoa class="SPTClientApplication"/>
<property name="current track" code="pTrk" description="The current playing track." type="track" access="r">
<cocoa key="currentTrack"/>
</property>
<property name="sound volume" code="pVol" description="The sound output volume (0 = minimum, 100 = maximum)" type="integer">
<cocoa key="soundVolume"/>
</property>
<property name="player state" code="pPlS" description="Is Spotify stopped, paused, or playing?" type="ePlS" access="r">
@ibehnam
ibehnam / Spotify's Commands in its SDEF file.xml
Created July 17, 2022 17:36
Spotify's Commands in its SDEF file
<command name="next track" code="spfyNext" description="Skip to the next track.">
<access-group identifier="com.spotify.playback"/>
<cocoa class="SPNextTrackScriptCommand"/>
</command>
<command name="previous track" code="spfyPrev" description="Skip to the previous track.">
<access-group identifier="com.spotify.playback"/>
<cocoa class="SPPreviousTrackScriptCommand"/>
</command>
<command name="playpause" code="spfyPlPs" description="Toggle play/pause.">
<access-group identifier="com.spotify.playback"/>
@ibehnam
ibehnam / My Karabiner.json
Last active July 20, 2022 18:09
My Karabiner-Elements
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
[('__add__', <method-wrapper '__add__' of tuple object at 0x7ff121d20860>),
('__class__', tuple),
('__class_getitem__', <function tuple.__class_getitem__>),
('__contains__',
<method-wrapper '__contains__' of tuple object at 0x7ff121d20860>),
('__delattr__',
<method-wrapper '__delattr__' of tuple object at 0x7ff121d20860>),
('__dir__', <function tuple.__dir__()>),
('__doc__',
"Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object."),
from inspect import getmembers
getmembers(l)
@ibehnam
ibehnam / foo.py
Last active October 21, 2022 20:18
l.count(3) # 1
l = (1, 2, 3, 4,)