This file contains 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/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
defaults write com.apple.dock persistent-apps -array | |
killall Dock | |
brew install arc fnm spotify 1password gpg credstash diff-so-fancy gnupg pyenv pinentry pinentry-mac yarn jpeg-turbo awscli imagesnap | |
brew install --cask visual-studio-code font-fira-code bettertouchtool insomnia scroll-reverser slack licecap docker | |
# maybe | |
# brew install applesimutils imagesnap |
This file contains 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
const svgExport = require("svgexport"); | |
const output = process.argv[2]; | |
const input = process.argv[3]; | |
const images = [ | |
[".android.png", "36:"], | |
["@1.5x.android.png", "54:"], | |
["@2x.android.png", "72:"], | |
["@2x.ios.png", "72:"], | |
["@3x.android.png", "108:"], | |
["@3x.ios.png", "108:"], |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
/* lazyload.js (c) Xander Dumaine | |
* MIT License (http://www.opensource.org/licenses/mit-license.html) | |
* | |
* Adapted from https://css-tricks.com/snippets/javascript/lazy-loading-images/ | |
* | |
* expects a bunch of | |
* `<img src="blank.gif" data-src="my_image.png">` | |
*/ | |
!function (window) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
for(i=1;i<101;i++){r=i%3?'':'fizz';r+=i%5?'':'buzz';!r||console.log(r)} |
This file contains 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
var baseAddress = new Uri(API_URL_BASE); | |
var cookieContainer = new CookieContainer(); | |
using (var handler = new HttpClientHandler() { CookieContainer = cookieContainer }) | |
using (var client = new HttpClient(handler) { BaseAddress = baseAddress }) | |
{ | |
// some defaults, add a header and cookie for authenticating with the API | |
client.DefaultRequestHeaders.Add("User-Agent", USER_AGENT); | |
client.DefaultRequestHeaders.Add("X-AvoSig", AvoSignature); | |
cookieContainer.Add(baseAddress, new Cookie(COOKIE_NAME, CookieValue)); | |
// Post the content and return the result |
This file contains 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
var uri = new Uri(API_URL_MEDIA); | |
var content = new MultipartFormDataContent(); | |
content.Add(new StringContent(caption), ""caption""); | |
var t = new StreamContent(photoContents); | |
t.Headers.ContentType | |
= new System.Net.Http.Headers.MediaTypeHeaderValue(contentType); | |
fileName = string.IsNullOrEmpty(fileName) ? ""img.png"" : fileName; | |
content.Add(t, ""media"", """ + fileName + """); | |
var response = PostBuffer(uri, content); | |
response.EnsureSuccessStatusCode(); |
This file contains 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
public void AddPhoto() | |
{ | |
DispatcherHelper.CheckBeginInvokeOnUI(() => { PickPhoto(); }); | |
} |
This file contains 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
// Create an OpenFilePicker starting in the pictures library, viewing thumbnails | |
var filePicker = new FileOpenPicker(); | |
filePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; | |
filePicker.ViewMode = PickerViewMode.Thumbnail; | |
// Filter to include a sample subset of file types | |
filePicker.FileTypeFilter.Clear(); | |
filePicker.FileTypeFilter.Add(".bmp"); | |
filePicker.FileTypeFilter.Add(".png"); | |
filePicker.FileTypeFilter.Add(".jpeg"); |
NewerOlder