Skip to content

Instantly share code, notes, and snippets.

@florido
florido / Disable_Hibernate_mode
Created May 1, 2019 03:40 — forked from hariel18/Disable_Hibernate_mode
OSX: Disable Hibernate mode
#http://www.engadget.com/2011/08/22/why-hibernate-or-safe-sleep-mode-is-no-longer-necessary-in-os/
#https://www.idelta.info/archives/some-hidden-changes-in-os-x-el-capitan/
# disable hibernation
sudo pmset hibernatemode 0
# clear the image file
sudo rm -rf /var/vm/sleepimage
# inhibit file recreation
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@florido
florido / Pinboard.scpt
Created April 30, 2019 23:06 — forked from itst/Pinboard.scpt
Import and update your Pinboard bookmarks to DEVONthink
(* Import and update your Pinboard bookmarks to DEVONthink
Based on work done by Christian Grunenberg on Mon Jan 23 2006,
Rafael Bugajewski to support Pinboard instead of Delicious on Sun Dec 19 2010 and
Andreas Zeitler on Sun Mar 03 2011 to display user feedback when finished.
By Sascha A. Carlin <https://sascha.carlin.de/> on 2018-03-07 to set the creation date of new record, show progress bar, use Pinboard Auth Token, use modification date of folder to fetch only recent items
Copyright (c) 2018. All rights reserved. *)
use framework "Foundation"
property targetDir : "/Users/bkelly/Dropbox/Notes/"
property editorApp : "/Applications/Byword.app"
on getNewFileName()
set fileName to (text returned of (display dialog "Enter the filename with extension" default answer "Untitled-1.md"))
return fileName
end getNewFileName
tell application "Byword"
set fname to my getNewFileName()
@florido
florido / smalltalk.txt
Created April 28, 2019 05:57 — forked from jgamblin/smalltalk.txt
Small Talk Quetions
What was your favorite toy growing up?
What accomplishment are you most proud of?
Which of your friends are you proudest of? Why?
What is the most beautiful place you’ve ever been?
What are your 3 favorite movies?
Who are the 3 greatest living musicians?
What is a great book you’ve read recently?
Do you feel like a leader at your compnay?
What is the most courageous thing you’ve ever done?
Who is the funniest person you know?
@florido
florido / GitHub curl.sh
Created April 19, 2019 08:15 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@florido
florido / curl.md
Created April 19, 2019 08:12 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@florido
florido / github-dl.sh
Created April 19, 2019 08:08 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@florido
florido / sugh.sh
Created April 4, 2019 09:54 — forked from erdincay/sugh.sh
su GitHub (downloading all repositories from a given user)
#!/bin/bash
if [ -z "$1" ]; then
echo "waiting for the following arguments: username + max-page-number"
exit 1
else
name=$1
fi
if [ -z "$2" ]; then