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
use std::collections::HashMap; | |
use std::future::Future; | |
use std::pin::Pin; | |
use std::sync::{Arc, Mutex}; | |
use std::task::{Context, Poll}; | |
// Just placeholders. | |
type CronetPtr = i32; | |
type CronetError = Box<dyn std::error::Error>; | |
type CronetResponse = String; |
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
use std::future::Future; | |
use std::pin::Pin; | |
use std::sync::{Arc, Mutex}; | |
use std::task::{Context, Poll}; | |
// Just placeholders. | |
type CronetPtr = i32; | |
type Error = Box<dyn std::error::Error>; | |
type CronetResult = std::result::Result<(), Error>; |
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
use std::collections::HashMap; | |
use std::sync::Mutex; | |
use lazy_static::lazy_static; | |
type GlobalMap = Mutex<HashMap<&'static str, &'static str>>; | |
lazy_static! { | |
static ref GLOBAL_DATA2: GlobalMap = Mutex::new(HashMap::new()); | |
} |
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 | |
# shellcheck shell=dash | |
# This is just a little script that can be downloaded from the internet to | |
# install SmashEnabler. | |
# | |
# It runs on Unix shells like {a,ba,da,k,z}sh. It uses the common `local` | |
# extension. Note: Most shells limit `local` to 1 var per line, contra bash. | |
# | |
# Borrow heavily and liberally from rustup's install script. ;P |
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
BEGIN MESSAGE. | |
VenBkaimvRMIPOo PTQMKFv9nlQPkrt Z8ZgVPVnJbnTBPT SmDTDHPHbr5Ayyv | |
ZxZsrGjpEkuCMy1 wiCFHpIaBxqTCKq 6Xr2MZHgg7Ci9mz qZCbwrVMkyYzc1R | |
4ejwW0WiGNZpvDu 1AcRFc8fl07FfcA 7I5l6Bd1ewiyYME KuMkAULCR5BtoWo | |
JPyyCzEDj40wXJy MsyBsT5lxmCqASL mD4gr0aLMzWSiL. | |
END MESSAGE. |
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
# pip install twython to get this library | |
from twython import Twython | |
# Create a new App at https://dev.twitter.com/, check off "sign in via Twitter", and get your tokens there | |
twitter = Twython('Consumer API Key', 'Consumer API Secret', 'Access Token', 'Access Token Secret') | |
# Read and upload the image, see image guidelines in post above~ | |
image = open('path/to/image.png', 'rb') | |
twitter.update_profile_image(image=image) |
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
override func touchesEnded(with event: NSEvent) { | |
if(self.isTracking) { | |
self.endTracking(leftAnchor?.constant ?? 0) | |
} | |
} | |
override func touchesCancelled(with event: NSEvent) { | |
if(self.isTracking) { | |
self.endTracking(leftAnchor?.constant ?? 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
override func touchesMoved(with event: NSEvent) { | |
if(!isTracking) { return } | |
let currentTouches = event.touches(matching: .touching, in: view) | |
if(currentTouches.count != 2) { return } | |
currentTouchOne = nil | |
currentTouchTwo = nil | |
currentTouches.forEach { (touch: NSTouch) in |
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
override func touchesBegan(with event: NSEvent) { | |
if(isTracking) { return } | |
let initialTouches = event.touches(matching: .touching, in: view) | |
if(initialTouches.count != 2) { return } | |
isTracking = true | |
initialPoint = view.convert(event.locationInWindow, from: nil) | |
let touches = Array(initialTouches) |
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 HolidayCalendarCollectionViewItem: NSCollectionViewItem { | |
var leftAnchor: NSLayoutConstraint? | |
var initialTouchOne: NSTouch? | |
var initialTouchTwo: NSTouch? | |
var currentTouchOne: NSTouch? | |
var currentTouchTwo: NSTouch? | |
var initialPoint: CGPoint? | |
var isTracking = false | |
public lazy var contentView: NSView = { |
NewerOlder