This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: teal; icon-glyph: magic; | |
// To use, add a parameter to the widget with a format of: image.png|padding-top|text-color|ture for online server image or false to load local image|Image filers eg: nature,blur | |
// The image should be placed in the iCloud Scriptable folder (case-sensitive). | |
// The padding-top spacing parameter moves the text down by a set amount. | |
// The text color parameter should be a hex value. | |
// For example, to use the image bkg_fall.PNG with a padding of 40 and a text color of red, | |
// the parameter should be typed as: bkg_fall.png|40|#ff0000|true|nature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; package --- Fix permissions for Emacs.app on macOS Catalina | |
;;; Author: Artem Loenko | |
;;; Mail-To: <artyom.loenko@mac.com> | |
;;; Commentary: | |
;;; Code: | |
(defconst _default-emacs-app-plist-path "/Applications/Emacs.app/Contents/Info.plist") | |
(defconst _temp-buffer-name "*fixing Emacs permissions*") | |
(defconst _temp-buffer (get-buffer-create _temp-buffer-name)) | |
(with-current-buffer _temp-buffer (erase-buffer)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql | |
brew install postgresql@9.6 | |
brew unlink postgresql@9.6 | |
brew link postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
# based on the script by MR Jain at https://gist.github.com/mrjain/891cc88809697fb6a9c8872942fa8873#file-hello_world-py | |
import sys, getopt | |
# Add the pandas library | |
import pandas as pd | |
import pandas_datareader.data as web | |
import psycopg2 as pg | |
import pandas.io.sql as psql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validate_sheet() | |
set coins to {} | |
-- retrieve the list of coins from number | |
tell application "Numbers" | |
tell table 1 of sheet 1 of document 1 | |
set cntRow to count row | |
set cntCol to count column | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Must install ImageMagick first | |
http://www.imagemagick.org/script/index.php | |
//This compresses a jpg with no visible loss of quality. Add in your own file names for target.jpg and result.jpg | |
convert -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% target.jpg result.jpg | |
// This does the same as above but to an entire folder (will overwrite original files): | |
mogrify -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% *.jpg | |
//This does the same thing but to all subfolders as well (Be careful with this one it will overwrite all original files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Creating an SSH key for you..." | |
ssh-keygen -t rsa | |
echo "Please add this public key to Github \n" | |
echo "https://github.com/account/ssh \n" | |
read -p "Press [Enter] key after this..." | |
echo "Installing xcode-stuff" | |
xcode-select --install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osascript send-imessage.scpt "hello" "Homam Hosseini" | |
osascript send-imessage-pic.scpt `realpath northamerica-neb.jpg` "Homam Hosseini" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Mail" | |
set theSubject to "Subject" -- the subject | |
set theContent to "Content" -- the content | |
set theAddress to "xxx@163.com" -- the receiver | |
set theSignatureName to "signature_name"-- the signature name | |
set theAttachmentFile to "Macintosh HD:Users:moligaloo:Downloads:attachment.pdf" -- the attachment path | |
set msg to make new outgoing message with properties {subject: theSubject, content: theContent, visible:true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script will install Command Line Tools for Xcode on a fresh installation of OS X. | |
# Usage: curl https://raw.github.com/gist/3053979/install-command-line-tools-for-xcode.sh | sh | |
DMG='command_line_tools_for_xcode_june_2012.dmg' | |
cd $HOME/Downloads | |
if [ ! -f ./$DMG ]; then | |
echo 'Command Line Tools for Xcode not downloaded.' |
NewerOlder