clang hello.c -c -o hello.o
ld hello.o -o hello
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Cocoa | |
| let loremIpsum = """ | |
| Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque erat risus, laoreet et eros id, lobortis elementum sem. Nullam nec magna massa. Donec gravida felis at odio tincidunt pretium et in orci. Curabitur suscipit porta purus non faucibus. Cras dapibus felis eu enim rutrum, vel aliquet lacus volutpat. Quisque fermentum vulputate dictum. Morbi mattis orci quis dui posuere, id vulputate turpis tempus. Sed vulputate augue at ullamcorper feugiat. Phasellus nec lacus eget sapien congue lacinia vel et nulla. Phasellus sollicitudin gravida dapibus. Donec molestie ullamcorper lacus eu rutrum. Praesent lacinia dignissim dui eu ultricies. Integer in lacus lobortis, porttitor sem eu, tincidunt dolor. Cras dignissim nisl in maximus ullamcorper. | |
| Proin nec vulputate magna. In interdum leo sit amet arcu consequat facilisis. Fusce ut malesuada ante, nec malesuada nisl. Mauris porta velit quis tortor mollis, in suscipit augue efficitur. Praesent eleifend mollis neque, non sempe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @propertyWrapper | |
| struct Escaping { | |
| typealias Closure = () -> Void | |
| var store: Closure | |
| var wrappedValue: Closure { | |
| get { self.store } | |
| set { self.store = newValue } | |
| } |
I'm using debian 10 as my daily so these are *nix commands. Mac should work with these too but you're on your own if you're using Windows. Goal for me is to make a headless raspberry pi I can SSH into and connect to my network using Ethernet. You should be comfortable in command line if you choose to follow this guide.
- Go to https://www.raspberrypi.org/downloads/raspbian and download Raspbian lite archive
unzipthe image- Plug in sdcard. Run
lsblkto see drives and mount points. Likely, the sdcard will show up in/dev/sdaor /dev/sdb and may have some partitions like/dev/sda1and/dev/sda2. - If partitions are mounted, unmount all of them. Ex:
umount /dev/sda1andumount /dev/sda2 - Copy the raspbian image to the sdcard with
sudo dd if=RASPBIAN_IMAGE_FILE.img of=/dev/sda bs=4M - Run
syncto ensure the written contents are flushed - OPTIONAL: To start ssh server on boot, Unplug sdcard and reinsert to remount new partitions. You'll have two with raspbian.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/stat.h> | |
| #include <unistd.h> | |
| #include <mach/mach.h> | |
| #include <mach/mach_vm.h> | |
| #include <dlfcn.h> | |
| #include <objc/runtime.h> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SDK = xcrun -sdk macosx | |
| all: compute.metallib compute | |
| compute.metallib: Compute.metal | |
| # Metal intermediate representation (.air) | |
| $(SDK) metal -c -Wall -Wextra -std=osx-metal2.0 -o /tmp/Compute.air $^ | |
| # Metal library (.metallib) | |
| $(SDK) metallib -o $@ /tmp/Compute.air |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // PerformanceMonitor.m | |
| // SuperApp | |
| // | |
| // Created by qianjianeng on 15/11/12. | |
| // Copyright © 2015年 Tencent. All rights reserved. | |
| // | |
| #import "PerformanceMonitor.h" | |
| #import <mach/mach.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // main.c | |
| // swinjector | |
| // | |
| // Created by rainyx on 13-7-24. | |
| // Copyright (c) 2013年 __MyCompanyName__. All rights reserved. | |
| // | |
| #include <stdio.h> | |
| #include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // BlockBasedSelector.h | |
| // | |
| // Created by Charlton Provatas on 11/2/17. | |
| // Copyright © 2017 CharltonProvatas. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| @interface BlockBasedSelector : NSObject |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIView+SafeAnchors.swift | |
| // | |
| extension UIView { | |
| var safeTopAnchor: NSLayoutYAxisAnchor { return optionalSafeAreaLayoutGuide?.topAnchor ?? topAnchor } | |
| var safeBottomAnchor: NSLayoutYAxisAnchor { return optionalSafeAreaLayoutGuide?.bottomAnchor ?? bottomAnchor } | |
| var safeLeftAnchor: NSLayoutXAxisAnchor { return optionalSafeAreaLayoutGuide?.leftAnchor ?? leftAnchor } |
NewerOlder