https://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=community&channel=Stable&version=VS18
https://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=enterprise&channel=Stable&version=VS18
| #!/usr/bin/env ruby | |
| # colorization without needing a gem | |
| class String | |
| def colorize(color_code) | |
| "\e[#{color_code}m#{self}\e[0m" | |
| end | |
| def red | |
| colorize(31) |
| ffmpeg -i confettis1.mov -vf unpremultiply=inplace=1 -c:v libvpx-vp9 -b:v 0 -crf 31 -s 924x1008 confettis.webm |
| @interface SREAGLContext : NSObject | |
| + (EAGLContext*)sharedContext; | |
| + (EAGLContext*)newContext: (EAGLRenderingAPI) api; | |
| @end | |
| @implementation SREAGLContext |
| # note these instructions are as of Dec 28, 2015 | |
| # the vlc and vlckit repos are super complex and have thousands of dependencies from everywhere on the internet. | |
| # so, you'll need to mess with things a bit | |
| git clone http://code.videolan.org/videolan/VLCKit.git | |
| cd VLCKit | |
| ./buildMobileVLCKit.sh -t |
| static BOOL isKeyFrame(CMSampleBufferRef sample) | |
| { | |
| auto a = CMSampleBufferGetSampleAttachmentsArray(sample, 0); | |
| if (CFArrayGetCount(a) > 0) { | |
| CFBooleanRef value; | |
| auto b = CFDictionaryGetValueIfPresent | |
| ((CFDictionaryRef) CFArrayGetValueAtIndex(a, 0) | |
| , kCMSampleAttachmentKey_NotSync | |
| , reinterpret_cast<const void **>(&value)) | |
| ; |
| // Use OpenGL 3.0+, but don't use GLU | |
| #define GLFW_INCLUDE_GL3 | |
| #define GLFW_NO_GLU | |
| #include <GL/glfw.h> | |
| #include <glm/glm.hpp> | |
| #include <glm/gtc/matrix_transform.hpp> | |
| #include <glm/gtc/type_ptr.hpp> | |
| extern "C" { |
| NSImage *CaptureScreen() { | |
| // Get the Screen Rect | |
| NSRect screenRect = [[NSScreen mainScreen] frame]; | |
| // Create a CGImage with the screen contents | |
| CGImageRef cgImage = CGWindowListCreateImage(screenRect, kCGWindowListOptionOnScreenOnly, kCGNullWindowID, kCGWindowImageDefault); | |
| // Convert the CGImage into a NSBitmapImageRep | |
| NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage]; |
| /* | |
| To use: | |
| 1) Get path to file/folder using file selection dialog. | |
| 2) Pass path to secscopGetBookmarkFromURL in order to get bookmark data for it. | |
| 3) Store this bookmark data somehow. | |
| 4) Tell the OS you want access to the file using secscopInitializeURLFromBookmarkData(). Store security-scoped url returned for later. | |
| 5) When you are done using the file call secscopStopUsingURL. | |
| You will need to do steps 4 and 5 every time you want to open a file across sessions. For example, if you have a recent files menu or a folder that a user selects once and you write data to across sessions. | |
| */ |
| #import <Cocoa/Cocoa.h> | |
| @interface NSColor (Hex) | |
| - (NSString *)hexadecimalValue; | |
| + (NSColor *)colorFromHexadecimalValue:(NSString *)hex; | |
| @end | |
| #import "NSColor+Hex.h" |