Skip to content

Instantly share code, notes, and snippets.

View misha-tgshv's full-sized avatar
🏠
Working from home

Misha Tugushev misha-tgshv

🏠
Working from home
View GitHub Profile
@chmurph2
chmurph2 / copyURLPlusSafari.scpt
Created February 26, 2009 01:12
In Safari, this applescript copies the title and URL of the current tab to the clipboard.
-- In Safari, this copies the Title and URL of the current tab to the clipboard.
-- Save the script in ~/Library/Scripts/Applications/Safari
-- Using QuickSilver, I assign a trigger to this script using the hotkey ⌥-C (option c), with the scope of the trigger limited to Safari.
-- Inspired by CopyURL + (http://copyurlplus.mozdev.org/)
-- Christopher R. Murphy
tell application "Safari"
set theURL to URL of front document
set theTitle to name of front document
set the clipboard to theTitle & return & theURL as string
@phinze
phinze / gist:5323078
Created April 5, 2013 22:12
delete all files in a folder with applescript ouch my eyezzzzzzzz
tell application "Finder"
set the appfiles to files in folder (POSIX file "/tmp/somefolder" as text)
repeat with appfile in appfiles
delete appfile
end repeat
end tell
@ledovsky
ledovsky / translit.py
Last active March 30, 2024 21:37
Транслитерация на python
# name: это строка которую транслитим
def transliterate(name):
"""
Автор: LarsKort
Дата: 16/07/2011; 1:05 GMT-4;
Не претендую на "хорошесть" словарика. В моем случае и такой пойдет,
вы всегда сможете добавить свои символы и даже слова. Только
это нужно делать в обоих списках, иначе будет ошибка.
"""
# Слоаврь с заменами
@davidvandenbor
davidvandenbor / hide_html.htaccess
Last active May 8, 2024 07:37
Apache: Hide HTML extension in URLs with htaccess
# This tag loads the rewrite module
<IfModule mod_rewrite.c>
# enable the rewrite engine
RewriteEngine On
# Set your root directory
RewriteBase /
# Remove the .html extension
RewriteCond %{THE_REQUEST} ^GET\ (.*)\.html\ HTTP
RewriteRule (.*)\.html$ $1 [R=301]
@scriptingosx
scriptingosx / Save Tabs to Notes.applescript
Created January 5, 2016 09:11
Save Safari Tabs to Notes
property defaultAccountName : "iCloud"
property defaultFolderName : "Saved Safari Windows"
global html
global processedURLs
on appendLineWithDoc(theDoc)
tell application "Safari"
tell theDoc
try
@RickCogley
RickCogley / Mac OS X Folder Action Upload Screenshot to Google Drive.sh
Last active September 22, 2022 23:19
Mac OS X Folder Action Upload Screenshot to Google Drive.sh
#!/bin/bash
# Author: Rick Cogley
# Updated: 27 Jan 2016
# Purpose: For use in a Mac OS X automator action, set to watch a screenshot folder.
# Assumes:
# GOPATH is set
# drive is installed (https://github.com/odeke-em/drive)
# there is a folder initialized with "drive init"
DRIVEINITPATH=$HOME/gdrive
#!/bin/bash
# Перекодирует рекурсивно в текущем каталоге имена
# файлов и каталогов в транслит.
#
# Источник: http://www.ubuntu.sumy.ua/2011/03/translit.html
shopt -s nullglob
for NAME in * ; do
TRS=`echo $NAME | sed "y/абвгдезийклмнопрстуфхцы/abvgdezijklmnoprstufxcy/"`
TRS=`echo $TRS | sed "y/АБВГДЕЗИЙКЛМНОПРСТУФХЦЫ/ABVGDEZIJKLMNOPRSTUFXCY/"`
@betahikaru
betahikaru / redmine-https-aws.md
Last active September 6, 2020 04:03
Setup Bitnami Redmine on AWS & certbot(Let's Encrypt)

[WIP]Setup Bitnami Redmine on AWS & certbot(Let's Encrypt)

Note: Created at 2016/08/07

Todos

  • Automation refresh by cron

References

  • Let's Encrypt
@kingluddite
kingluddite / Default (OSX).sublime-keymap
Created August 18, 2016 19:24
mac key bindings sublime text 3
[
// enter command mode in Vintage
{ "keys": ["j", "j"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
@keg
keg / python_url_checker.py
Created November 10, 2016 23:09
Python redirect checker
#!/usr/bin/python
import csv
import requests
csv_data_to_write = [['original url', 'destination url',
'final http status', 'redirect path']]
def redirect_history(history):
'''repack urls to a neat list'''