Skip to content

Instantly share code, notes, and snippets.

View deftdawg's full-sized avatar

deftdawg

  • Toronto
View GitHub Profile
@walesmd
walesmd / IconServiceAgent.md
Last active June 4, 2024 19:48
A lot of people are having issues with com.apple.IconServicesAgent. Since this is a very new issue, Google was no help and `man iconservicesd` is even more hilarious. I eventually fixed it, when I was working on a completely different issue (that is still not fixed). The instructions are below and on the Apple Support Forum, https://discussions.…

I was chasing down another issue (slow "Save As") and thought these two issues may have been related (with QuickLook being the common broken link). Unfortunately, my "Save As" dialog is still miserably slow on the initial load; but IconServicesAgent hasn't gone above 30MB and he rarely makes an appearance in the Console!

Some of these steps may not be necessary, but here are all of the steps I took that inadverdently put IconServicesAgent back in its place. Note: all commands are a single-line, if they appear to be multiple that's just the forum formatting.

  1. Check for any QuickLooks related .plist files. In a terminal: mdfind com.apple.quicklook. -name .plist

  2. I only had files at the system level (specifically within /System/Library/LaunchAgents/). If you have others, modify the directions below to take that into account (re-introducing plist files from the system level back up to the user).

  3. Make some temporary directories to store these plist files, just in case: mkdir ~/tmp-quicklook

@stevendeboer
stevendeboer / logstash.conf
Last active December 28, 2015 00:09
Using anonymize filter to add checksum.
# Add field which is composed of multiple source fields.
filter {
mutate {
add_field => [ "hash", "%{field1}/%{field2}/%{field3}" ]
}
anonymize {
algorithm => "SHA1"
fields => [ "hash" ]
key => "keyvalue"
@fardjad
fardjad / rpi-toolchain.md
Last active August 4, 2021 13:48
[How to Build an ARM Toolchain on OSX for RaspberryPI] WIP #raspberrypi #toolchain #osx #arm

Building an ARM Toolchain on OSX for RaspberryPI

Requirements

  1. MacPorts

     sudo port selfupdate
     sudo port upgrade outdated
    
  2. GCC prerequisites

@isimmons
isimmons / gist:8202227
Last active July 26, 2024 16:15
Truncate tables with foreign key constraints in a Laravel seed file.

For the scenario, imagine posts has a foreign key user_id referencing users.id

public function up()
{
	Schema::create('posts', function(Blueprint $table) {
		$table->increments('id');
		$table->string('title');
		$table->text('body');
@ejdyksen
ejdyksen / patch-edid.md
Last active July 31, 2024 19:16
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@sauthieg
sauthieg / PrintSessionFilter.groovy
Created October 17, 2014 09:27
Prints the content of the session on System.out
import groovy.json.JsonOutput
println "SESSION BEFORE"
println JsonOutput.prettyPrint(JsonOutput.toJson(exchange.session))
next.handle(exchange)
println "SESSION AFTER"
println JsonOutput.prettyPrint(JsonOutput.toJson(exchange.session))
@jonikarppinen
jonikarppinen / CustomErrorController.java
Last active June 16, 2021 02:19
Example of replacing Spring Boot "whitelabel" error page with custom error responses (with JSON response body)
package com.company.project.controllers;
import com.company.project.model.api.ErrorJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.web.ErrorAttributes;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestAttributes;
class ViewController: UIViewController, OEEventsObserverDelegate {
var openEarsEventsObserver = OEEventsObserver()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
openEarsEventsObserver.delegate = self
@mrlesmithjr
mrlesmithjr / ansible-macos-homebrew-packages.yml
Last active July 18, 2024 20:59
Install MacOS Homebrew Packages With Ansible
---
- name: Install MacOS Packages
hosts: localhost
become: false
vars:
brew_cask_packages:
- atom
- docker
- dropbox
- firefox
@timdorr
timdorr / ownerapi_endpoints.json
Created February 11, 2017 14:37
Tesla API Endpoints
{
"AUTHENTICATE": {
"TYPE": "POST",
"URI": "oauth/token",
"AUTH": false
},
"REVOKE_AUTH_TOKEN": {
"TYPE": "POST",
"URI": "oauth/revoke",
"AUTH": true