Skip to content

Instantly share code, notes, and snippets.

View unforswearing's full-sized avatar

Alvin Charity unforswearing

View GitHub Profile
@maxfenton
maxfenton / macos_defaults.md
Last active November 8, 2023 23:57
Mac system defaults tricks

System stuff for a mac

What the defaults do and how to undo them

Dropshadows on screenshots

defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer
@kany
kany / sendmail_setup.md
Last active September 22, 2023 00:16
Setup SENDMAIL on Mac OSX Yosemite

Google Apps Script Spreadsheet Utilities and Custom Functions#

These utilities are grouped into related files, for simpler copy & paste to your scripts.

ConvertA1.gs

A couple of helper functions to convert to & from A1 notation.

cellA1ToIndex( string cellA1, number index )

@zeusdeux
zeusdeux / compose.js
Last active December 25, 2019 04:04
Functional programming toolkit for javascript
//this function composes functions like in Haskell (and most other functional languages)
//the final composed function can accept parameters dictated by the chain it creates
//you can pass it a list of functions and it shall apply them from RIGHT to LEFT (right associativeness?)
//eg., c0(fn1, fn2, fn3)(10) => return fn1(fn2(fn3(10)));
// out<---<----<----<=10
function c0(f, g) {
var last;
if (!arguments.length) return;
if (arguments.length === 1) return f;
if (arguments.length === 2) {
@n8henrie
n8henrie / txt_to_reminders.applescript
Last active March 11, 2024 17:04
Demonstration of using AppleScript with Reminders.app
--taken from http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/#comment-1346894559
--set theFileContents to (read file "Users:n8henrie:Desktop:Reminders.txt") -- Change this to the path to your downloaded text file with your tasks in it! (Note the : instead of a / between folders) Or, just name them Reminders.txt and put them in your downloads folder
--set theLines to paragraphs of theFileContents
set theLines to {"task name 1", "task name 2"}
repeat with eachLine in theLines
tell application "Reminders"
set mylist to list "Your List Name"
tell mylist
make new reminder at end with properties {name:eachLine, due date:date "7/10/2014 3:00 PM"}
@ttscoff
ttscoff / spl.rb
Created May 2, 2014 14:46
A Sentaku-based wrapper for mdfind
#!/usr/bin/ruby
require 'shellwords'
query = ARGV.length > 0 ? ARGV.join(" ") : "date:today"
files = %x{mdfind '#{ARGV.join(" ")}'}.split("\n")[0..100]
filehash = {}
files.each {|file|
base = File.basename(file)
@jcouyang
jcouyang / all github 887 emojis.md
Last active February 5, 2018 08:05
all github 887 emoji

💯 👍 👎 🔢 🎱 🅰️ 🆎 🔤 🔡 🉑 🚡 ✈️ ⏰ 👽 🚑 ⚓ 👼 💢 😠 😧 🐜 🍎 ♒ ♈ ◀️ ⏬ ⏫ ⬇️ 🔽 ▶️ ⤵️ ⤴️ ⬅️ ↙️ ↘️ ➡️ ↪️ ⬆️ ↕️ 🔼 ↖️ ↗️ 🔃 🔄 🎨 🚛 😲 👟 🏧 🅱️ 👶 🍼 🐤 🚼 🔙 🛄 🎈 ☑️ 🎍 🍌 ‼️ 🏦 📊 💈 ⚾ 🏀 🛀 🛁 🔋 🐻 🐝 🍺 🍻 🪲 🔰 🔔 🍱 🚴 🚲 👙 🐦 🎂 ⚫ 🃏 ⬛ ◾ :

@guilherme
guilherme / gist:9604324
Last active February 24, 2024 20:39
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then
@miguelmota
miguelmota / README.md
Last active March 16, 2024 12:52
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@pipwerks
pipwerks / Convert "localhost" address to your Mac's current IP address
Last active August 29, 2015 13:57
AppleScript for converting "localhost" address to your Mac's current IP address. This enables testing in VMs (they can't resolve localhost but *can* resolve the local IP). This also enables your coworkers to view pages being served from your Mac. Read more at http://pipwerks.com/2014/03/08/convert-localhost-to-your-macs-current-ip-address/
(* functions *)
-- string replace function from http://www.macosxautomation.com/applescript/sbrt/sbrt-06.html
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text