Skip to content

Instantly share code, notes, and snippets.

View roblav96's full-sized avatar

Robert Laverty roblav96

View GitHub Profile
@rchl
rchl / augment_plugin_profile.py
Last active August 11, 2020 05:20
Sublime Text plugin for highlighting biggest offenders in Plugin Event Profile page
import sublime
import sublime_plugin
import re
class PluginEventProfileListener(sublime_plugin.ViewEventListener):
def on_activated_async(self):
view = self.view
if not view.is_scratch() or not view.name() or view.name() != 'Plugin Event Profile':
return
@Kozlov-V
Kozlov-V / example.m
Last active June 18, 2021 03:39
upload task in background using afnetworking + progress
Use:
NSURLSessionConfiguration:backgroundSessionConfiguration:
instead of
NSURLSessionConfiguration:defaultSessionConfiguration
From the NSURLSessionConfiguration:backgroundSessionConfiguration: documentation:
Upload and download tasks in background sessions are performed by an external daemon instead of by the app itself. As a result, the transfers continue in the background even if the app is suspended, exits, or crashes.
So in your case, change:
@OdatNurd
OdatNurd / Default.sublime-commands
Created January 20, 2021 05:16
Easily open the Sublime Plugin API files
[
{ "caption": "Developer: Open API Files", "command": "open_api_files" },
]
@jfcherng
jfcherng / CompletionItemDemo.py
Last active August 10, 2021 05:19
Sublime Text 4 demo: CompletionItem (Min ST version: 4073)
import sublime
import sublime_plugin
# @see https://discordapp.com/channels/280102180189634562/280157067396775936/697124502244687984
class CompletionItemDemoListener(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
return (
[
sublime.CompletionItem(
@sloanlance
sloanlance / disable_macOS_parental_controls.sh
Last active September 7, 2021 16:00
Disable Parental Controls and other services in macOS Sierra (OS X)
#!/bin/bash
# This is a draft but it works
# FIRST (I don't even know if it works but we'll assume yes)
# sudo launchctl list
# sudo launchctl disable system/netbiosd
# sudo launchctl disable system/parsecd
# sudo launchctl disable system/parentalcontrols.check
# sudo launchctl disable system/airportd
@jfcherng
jfcherng / st4-kind-scope-relationship
Last active December 11, 2021 17:00
ST 4 Autocompletion: Kind <---> Scope relationship
https://discord.com/channels/280102180189634562/280157067396775936/736233105295278120
keyword:
keyword
storage.modifier
storage.type
keyword.declaration
variable.language
constant.language
type:
@pgeorgan
pgeorgan / etc-hosts
Last active March 13, 2022 20:27
Block OSX El Capitan from phoning home
################################################################################
# PRIVACY RULES #
# * OSX EL CAPITAN - NO CONNECTIONS TO CUPPERTINO * #
# MIX OF DIFFERENT /etc/hosts FILES I'VE FOUND. 80% OF THE ENTRIES CAME FROM #
# MY OWN. OSX SENDS HUGE AMMOUNT OF REQUESTS TO CUPPERTINO EVENT WHEN #
# SPOTLIGHT SUGGESTIONS, ICLOUD, AND OTHER SERVICES ARE DISABLED #
# USE IT IF YOU DON'T LIKE OSX CALLING HOME WHEN YOU DON'T WANT IT TO HAPPEN #
# NO CONNECTIONS TO APPLE SERVERS REPORTED BY MY FIREWALL FOR 2 MONTHS #
################################################################################
# SAVED FROM: http://pastebin.com/GfaXGL4r
@denji
denji / unbound-osx-homebrew.md
Last active November 27, 2022 08:33
Install unbound DNS(SEC) resolver on OS X, on the basis of https://www.spatof.org/blog/unbound-dns-resolver-on-osx.html
To install unbound you can use homebrew
$ brew install unbound ldns
Now we can edit the configuration file of unbound which by default is located in /usr/local/etc/unbound/unbound.conf:
@florido
florido / defaults.sh
Created June 1, 2020 00:23 — forked from andrewp-as-is/defaults.sh
🍎 macOS security
#!/usr/bin/env bash
# Disable Face Detect in Photos app
defaults write com.apple.iPhoto PKFaceDetectionEnabled 0
defaults write com.apple.gamed Disabled -bool true
defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES # log out, log in
@andrewp-as-is
andrewp-as-is / defaults.sh
Last active February 24, 2023 17:58
macOS security
#!/usr/bin/env bash
# Disable Face Detect in Photos app
defaults write com.apple.iPhoto PKFaceDetectionEnabled 0
defaults write com.apple.gamed Disabled -bool true
defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES # log out, log in