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 Default.exec | |
| ExistingCommandMap = { } | |
| class build_python3(Default.exec.ExecCommand): | |
| def run(self, cmd=None, kill=False, **kwargs): | |
| file = cmd | |
| if file in ExistingCommandMap: | |
| existing = ExistingCommandMap[file] |
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
| class Envelope { | |
| constructor(type, strength, fromValue, toValue, sampleCount) | |
| { | |
| this._generate(type, strength, fromValue, toValue, sampleCount); | |
| } | |
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
| Note: | |
| 1) These may change in future versions of macOS. | |
| 2) Apple may also add more appearances or control accent colors in the future. | |
| 3) You probably don't want to hardcode color values. | |
| 4) Watch: | |
| https://developer.apple.com/videos/play/wwdc2018/210 | |
| https://developer.apple.com/videos/play/wwdc2018/218 | |
| All colors specified in the sRGB color space. |
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 <math.h> | |
| #include <Accelerate/Accelerate.h> | |
| /* filter signal x with filter h and store the result in output. | |
| * output must be at least as long as x | |
| */ | |
| void | |
| fft_fir_filter( const float *x, | |
| unsigned x_length, |
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
| #!/usr/bin/ruby | |
| s = ARGV[0] | |
| if s =~ /^0x/ then | |
| n = s.hex | |
| else | |
| n = s.to_i | |
| end |
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
| function ease(p) { | |
| p *= 5; | |
| if (p < 1) { | |
| return (-0.9 * Math.cos(p * (Math.PI / 2)) + 0.9 + (0.1 * p)) * 0.3; | |
| } else { | |
| p = ((p - 1) / 4); | |
| var p1 = p - 1; | |
| return (((p1 * p1 * p1 + 1) * 0.9) + p * 0.1) * 0.7 + 0.3; |
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
| // Fade Ins: | |
| // Linear: | |
| for (let i = 0; i < length; i++) { | |
| array[i] = i / length; | |
| } | |
| // Exponential, Concave Up: | |
| let silence = Math.pow(10.0, -120.0 / 20.0); // Silence is -120dB | |
| let fromValue = silence; |
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
| #!/bin/sh | |
| IFS=$'\n' | |
| FORCE=0 | |
| compress_png () { | |
| more_args="" | |
| # Note: I use an "og_" prefix on a file to indicate "opaque and grayscale", | |
| # "g_" for grayscale, and "o_" for opaque. |
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
| #!/bin/sh | |
| IFS=$'\n' | |
| FORCE=0 | |
| compress_png () { | |
| more_args="" | |
| if [[ $1 = og_* ]]; then | |
| more_args="-c 0" |
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
| /* | |
| When MTSDebugTouchEvents() is called, -[UIApplication sendEvent:] will flash | |
| the views which receive touch events. | |
| */ | |
| @implementation UIApplication (MTSDebug) | |
| - (void) mts_sendEvent_highlightTouches:(NSArray *)touches | |
| { | |
| static NSMutableDictionary *sViewToWindowMap = nil; |