Skip to content

Instantly share code, notes, and snippets.

@juliengrimault
juliengrimault / FileFunctionLevelFormatter.h
Created March 17, 2012 03:33
Cocoa Lumberjack formatter showing file, function and level of the log
//
// FileFunctionLevelFormatter.h
//
// Created by Julien Grimault on 23/1/12.
// Copyright (c) 2012 Julien Grimault. All rights reserved.
//
#import "DDLog.h"
@interface FileFunctionLevelFormatter : NSObject <DDLogFormatter>
@kevinoid
kevinoid / windowTimers.js
Created July 19, 2012 20:05
An implementation of setInterval/setTimeout for Rhino and SpiderMonkey
/* Implementation of HTML Timers (setInterval/setTimeout) based on sleep.
*
* This file is provided under the following terms (MIT License):
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@bstahlhood
bstahlhood / UIImage+Retina4.h
Created September 13, 2012 00:51
Swizzled UIImage imageNamed for iPhone 5
//
// UIImage+Retina4.h
// StunOMatic
//
// Created by Benjamin Stahlhood on 9/12/12.
// Copyright (c) 2012 DS Media Labs. All rights reserved.
//
#import <UIKit/UIKit.h>
anonymous
anonymous / blockerList.json
Created June 25, 2015 00:05
Testing Safari Content Blocker on iMore.com
[
{
"action": {
"type": "block"
},
"trigger": {
"url-filter": ".*",
"resource-type": ["script"],
"load-type": ["third-party"],
"if-domain": ["imore.com"]
@sundeepgupta
sundeepgupta / thin-frameworks.sh
Created February 23, 2017 13:58
Bash script to thin fat iOS frameworks. Strips non-valid architectures from fat framework binaries.
# Adapted from https://github.com/realm/realm-cocoa/blob/master/scripts/strip-frameworks.sh
# This script strips all non-valid architectures from dynamic libraries in
# the application's `Frameworks` directory which is required for App Store submission.
#
# The following environment variables are required:
#
# BUILT_PRODUCTS_DIR
# FRAMEWORKS_FOLDER_PATH
# VALID_ARCHS
@justinlevi
justinlevi / disable-adobe.sh
Created November 16, 2017 17:55
Disable all Adobe Processes
#!/bin/bash
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
launchctl unload -w /Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist
launchctl unload -w /Library/LaunchAgents/com.adobe.ARMDCHelper.cc24aef4a1b90ed56a725c38014c95072f92651fb65e1bf9c8e43c37a23d420d.plist
launchctl unload -w /Library/LaunchDaemons/com.adobe.agsservice.plist
launchctl unload -w /Library/LaunchDaemons/com.adobe.ARMDC.Communicator.plist
launchctl unload -w /Library/LaunchDaemons/com.adobe.ARMDC.SMJobBlessHelper.plist
launchctl unload -w /Library/LaunchDaemons/com.adobe.adobeupdatedaemon.plist
sudo launchctl unload -w /Library/LaunchDaemons/com.adobe.ARMDC.Communicator.plist
@tadija
tadija / AECoreData.swift
Last active June 19, 2022 15:34
AECoreData
/**
* https://gist.github.com/tadija/6003830264d67a87193ff0c3d20373e7
* Revision 10
* Copyright © 2018-2021 Marko Tadić
* Licensed under the MIT license
*/
import CoreData
@available(iOS 10.0, *)
@jmarkstar
jmarkstar / AlamofireCodable.swift
Last active June 6, 2023 16:45
Decode Alamofire response to a Generic codable type but if we get http code 400, I decode different json which is a error message.
@discardableResult
private func performRequest<T:Decodable>(route: APIRouter, decoder: JSONDecoder = JSONDecoder(), completion:@escaping (Int, Result<T>)->Void) -> DataRequest {
return Alamofire.request(route).responseData() { responseData in
guard let response = responseData.response else {
completion(APIClient.responseErrorCode, .failure(ApiError.internalServerError(NSLocalizedString("service_error", comment: AppConstant.EMPTY))))
return
}
@EitanBlumin
EitanBlumin / ultimate_compression_savings_estimation_whole_database.sql
Last active June 26, 2024 03:06
This ultimate script performs compression savings estimation check for an ENTIRE database, includes comparison between PAGE and ROW compression types, cautionary table size checks, AND it generates the remediation scripts for you! (more info: https://eitanblumin.com/2020/02/18/ultimate-compression-savings-estimation-script-entire-database/ )
----------------------------------------------------------------
-------- Ultimate Compression Savings Estimation Check ---------
----------------------------------------------------------------
-- Author: Eitan Blumin | https://www.eitanblumin.com
-- Create Date: 2019-12-08
-- Source: http://bit.ly/SQLCompressionEstimation
-- Full Link: https://gist.github.com/EitanBlumin/85cf620f7267b234d677f9c3027fb7ce
-- GitHub Repo: https://github.com/MadeiraData/MadeiraToolbox/blob/master/Utility%20Scripts/ultimate_compression_savings_estimation_whole_database.sql
-- Blog: https://eitanblumin.com/2020/02/18/ultimate-compression-savings-estimation-script-entire-database/
----------------------------------------------------------------