Skip to content

Instantly share code, notes, and snippets.

@andermoran
andermoran / changeMacBrightness.m
Last active August 30, 2023 05:23
Programmatically read and change the brightness on macOS
#import <Foundation/Foundation.h>
#import <IOKit/IOKitLib.h>
#import <IOKit/graphics/IOGraphicsLib.h>
// this helped me out a lot <3: https://stackoverflow.com/questions/3239749/programmatically-change-mac-display-brightness
int main(int argc, char *argv[]) {
io_iterator_t iterator;
kern_return_t result = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("IODisplayConnect"), &iterator);
@yohhoy
yohhoy / yuvrgb.md
Last active March 29, 2024 00:19
RGB <=> YCbCr(YPbPr) color space conversion
Y  = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
BT.601 BT.709 BT.2020
a 0.299 0.2126 0.2627
b 0.587 0.7152 0.6780
@atdrendel
atdrendel / debug.xcconfig
Last active May 11, 2023 11:50
Xcode configuration for iOS, macOS, watchOS, and tvOS framework
// -*- SHARED -*-
SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator
COMBINE_HIDPI_IMAGES = YES
INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks
SKIP_INSTALL = YES
COPY_PHASE_STRIP = NO
IPHONEOS_DEPLOYMENT_TARGET = 14.0
MACOSX_DEPLOYMENT_TARGET = 10.15
TVOS_DEPLOYMENT_TARGET = 14.0
@Tomasvrba
Tomasvrba / 360TimelapseTutorial.md
Last active December 17, 2022 22:18
HD 360° Timelapse and FFmpeg tutorial

How to capture, stitch and publish a 360° timelapse

Consumer ready 360° cameras are becoming ever more accessible and many people are experimenting with a variety of 360° content. Out of the many cameras on the market the Ricoh Theta S is one of the most user-friendly, turn-key solutions with lots of built-in features. However, the camera's videos are limited 1920x960 resolution and the Theta+ app only lets you create a timelapse with up to 300 or 400 images. The workaround is to use interval shooting to capture as many images as you'd like at the 5376x2688 to full resolution and then stitch them together manually into an HD video. There are few GUI solutions (especially open-source/free) which let you do this with ease. Here's how you do it:

Set up interval shooting on your Ricoh Theta S

@emrahgunduz
emrahgunduz / WebImageDownloader.cpp
Last active January 25, 2023 21:15
Web Image Downloader For Unreal Engine 4 -- Do not forget to change the include and API key in your own classs, if you simply copy-pasting this.
// (c) 2016 Markakod
#include "HitMe.h"
#include "WebImageDownloader.h"
UWebImageDownloader* UWebImageDownloader::GetWebImageDownloader(FString WebImageName, FString URL, bool& IsValid)
{
IsValid = false;
UWebImageDownloader *Object = NewObject<UWebImageDownloader>();
@subfuzion
subfuzion / curl.md
Last active April 17, 2024 04:24
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@madhikarma
madhikarma / build_framework.sh
Created October 13, 2015 12:26
Script to build a framework for multiple architectures
# Merge Script
# http://code.hootsuite.com/an-introduction-to-creating-and-distributing-embedded-frameworks-in-ios/
# 1
# Set bash script to exit immediately if any commands fail.
set -e
# 2
# Setup some constants for use later on.
@drewsberry
drewsberry / UE4-build.bat
Last active February 21, 2024 07:33
UE4 Windows command line building
:: Build client
RunUAT BuildCookRun -project="full_path.uproject"^
-noP4 -platform=Win64^
-clientconfig=Development -serverconfig=Development^
-cook -allmaps -build -stage^
-pak -archive -archivedirectory="Output Directory"
:: Cook client
RunUAT BuildCookRun -project="full_project_path_and_project_name".uproject^
-noP4 -platform=Win64^
@kharmabum
kharmabum / ocmock-cheatsheet.m
Last active October 8, 2022 07:55
OCMock cheatsheet
/*----------------------------------------------------*/
#pragma mark - XCTAsserts
/*----------------------------------------------------*/
XCTAssert(expression, format...);
XCTAssertTrue(expression, format...);
XCTAssertFalse(expression, format...);
XCTAssertEqual(expression1, expression2, format...);
XCTAssertNotEqual(expression1, expression2, format...);
XCTAssertNil(expression, format...);
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule