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
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active October 2, 2024 15:15
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@vitorgalvao
vitorgalvao / Get Title and URL.applescript
Last active August 21, 2024 14:42
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.
-- Webkit variants include "Safari", "Webkit", "Orion".
-- Specific editions are valid, including "Safari Technology Preview".
-- "Safari" Example:
tell application "Safari" to return name of front document
@alisdair
alisdair / kill-sticky.js
Created May 29, 2013 13:43
Kill sticky headers.
(function () {
var i, elements = document.querySelectorAll('body *');
for (i = 0; i < elements.length; i++) {
if (getComputedStyle(elements[i]).position === 'fixed') {
elements[i].parentNode.removeChild(elements[i]);
}
}
})();
@awesomebytes
awesomebytes / ipython_to_file.md
Created March 16, 2016 10:38
Save iPython session to a python file as code

Save an iPython session commands/code to a file

You must use the magic method %save:

In [1]: %save?
Type:       Magic function
String Form:<bound method CodeMagics.save of <IPython.core.magics.code.CodeMagics object at 0x7fb5d25bb1d0>>
Namespace:  IPython internal
File: /usr/lib/python2.7/dist-packages/IPython/core/magics/code.py
@jchandra74
jchandra74 / PowerShell Customization.md
Last active August 20, 2024 20:27
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@metacritical
metacritical / racket-clojure-rant.md
Last active September 2, 2022 00:43
Racket-Lisp-Scheme-Clojure Rant and Answers.

Two gentlemen and their rant on languages.

Rant

  • Racket & scheme are orders of magnitude faster than clojure.
  • I like lisp but I hate this clojure movement. Especially when 60% of it is written in Java.
  • Are there major java libraries for which there is no scheme implementations?
  • Why did people pick up clojure rather than racket. Hype?

Recon and Attack Vectors from My Logs

This document contains excerpts from my web server logs collected over a period of 7 years that shows various kinds of recon and attack vectors.

There were a total of 37.2 million lines of logs out of which 1.1 million unique HTTP requests (Method + URI) were found.

$ sed 's/^.* - - \[.*\] "\(.*\) HTTP\/.*" .*/\1/' access.log &gt; requests.txt
@RobertAKARobin
RobertAKARobin / python.md
Last active August 20, 2024 17:25
Python Is Not A Great Programming Language
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@gwangjinkim
gwangjinkim / how-to-save-entire-python-sessions-or-objects-or-session-code.py
Last active August 29, 2024 05:45
How to save entire Python sessions, single objects or only a session's code?
"""
Lisp languages support an image-based development cycle at the REPL.
R - having its roots in Lisp - it was first implemented in Scheme - has overtaken this.
R's base command `save.image(filepath)` can save the state of an entire REPL session in a file,
and next time you start R, you can start where you stopped, by hitting `load(filepath)`.
I was asking myself, since Python's REPL is ipython, what supports
similar functionailities for pythonistas.