This library is now deprecated in favour of a more complete and SwiftUI friendly TextEditor
backport:
https://github.com/shaps80/SwiftUIBackports
See it in action here: https://twitter.com/shaps/status/1654972428286668800?s=20
var body: some View { | |
ParticlesEmitter { | |
Particle(.circle(4)) | |
.color(.red) | |
.velocity(25) | |
.scale(0.10) | |
.alphaSpeed(-0.3) | |
.spinRange(1) | |
.lifetime(5) |
This library is now deprecated in favour of a more complete and SwiftUI friendly TextEditor
backport:
https://github.com/shaps80/SwiftUIBackports
See it in action here: https://twitter.com/shaps/status/1654972428286668800?s=20
# Swift syntax highlighting for Vim | |
# Original Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/ | |
# Another helpful article: https://billyto.github.io/blog/swift-syntax-vim | |
# More about Vim packages: http://vimcasts.org/episodes/packages/ | |
echo "--- creating ~/.vim/pack/bundle/start dir.." | |
mkdir -p ~/.vim/pack/bundle/start | |
echo "--- Cloning Apple's Swift repo.." |
If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:
let
and const
statements. For the purposes of the React documentation, you can consider them equivalent to var
.class
keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this
in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav/* | |
Create this as a file ~/Library/KeyBindings/DefaultKeyBinding.dict | |
Then restart your computer. | |
NOTE: ~ means alt/option | |
^ means ctrl | |
*/ | |
{ | |
"~f"="moveWordForward:"; | |
"~b"="moveWordBackward:"; | |
"~<"="moveToBeginningOfDocument:"; |
import sun.misc.BASE64Decoder; | |
import java.io.IOException; | |
import java.security.KeyFactory; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.PublicKey; | |
import java.security.Signature; | |
import java.security.spec.InvalidKeySpecException; | |
import java.security.spec.X509EncodedKeySpec; |
Open a terminal window and cd into a folder under the repository. Then: | |
git fsck | awk '{print $3}' > tmp.txt | |
cat tmp.txt | xargs git show > tmp2.txt | |
Now open tmp2.txt in editor, locate your lost code, and find the commit-id on top of it. Then apply the code: | |
git stash apply <commit id> | |
rm tmp.txt tmp2.txt |
// | |
// Created by Eric Firestone on 3/22/16. | |
// Copyright © 2016 Square, Inc. All rights reserved. | |
// Released under the Apache v2 License. | |
// | |
// Adapted from https://gist.github.com/blakemerryman/76312e1cbf8aec248167 | |
import Foundation | |
interface Array<T> { | |
flatMap<E>(callback: (t: T) => Array<E>): Array<E> | |
} | |
Object.defineProperty(Array.prototype, 'flatMap', { | |
value: function(f: Function) { | |
return this.reduce((ys: any, x: any) => { | |
return ys.concat(f.call(this, x)) | |
}, []) | |
}, |
-(void) buttonClick:(NSButton *)sender { | |
// Create view controller | |
EXPopoverViewController *viewController = [[EXPopoverViewController alloc] init]; | |
// Create popover | |
NSPopover *entryPopover = [[NSPopover alloc] init]; | |
[entryPopover setContentSize:NSMakeSize(200.0, 200.0)]; | |
[entryPopover setBehavior:NSPopoverBehaviorTransient]; | |
[entryPopover setAnimates:YES]; | |
[entryPopover setContentViewController:viewController]; |