Skip to content

Instantly share code, notes, and snippets.


Sufiyan Yasa xr1337

View GitHub Profile
xr1337 /
Last active Jul 2, 2020
Google script to clean up root drive folder. All files are moved to their extension( mimetype) folder
/// returns extension from the file object
/// Queries the mimetype
const getExtension = function(file) {
var mime = file.getMimeType()
var docType = mime.split("/").pop()
return docType.split(".").pop()
/// send an email to myself when any files are moved
xr1337 / main.go
Created Aug 10, 2020
View main.go
package main
import (
xr1337 / question.swift
Created Aug 10, 2020
unique substrings
View question.swift
import Cocoa
func fewestCoins(coins: String) -> Int {
let coinsArray = Array(coins)
let checkSet :Set = Set(coinsArray)
let countedSet :NSCountedSet = NSCountedSet()
// validation when the lenght of the string == amount uniq characters
if(checkSet.count == coins.count || checkSet.count == 0) {
return coins.count
xr1337 / Example script to open all logs
Last active May 24, 2021
A script to stream all the logs that simulator is currently booted
View Example script to open all logs
A=`xcrun simctl list | grep Booted | perl -ne 'print "$1\n" if / \(([0-9A-Z\-]+)\) /' | sort | uniq `
for UUID in $A
xcrun simctl spawn $UUID log stream --level debug\
--timeout 1h\
--style compact \
--predicate 'subsystem == ""' &