Skip to content

Instantly share code, notes, and snippets.

View buguibu's full-sized avatar
🍎
new company new challenges 💪

Víctor Gutiérrez Blanco buguibu

🍎
new company new challenges 💪
  • Madrid
View GitHub Profile
@buguibu
buguibu / GoogleSheetScriptDynamicDropDowns.txt
Last active December 1, 2022 11:28
Dinamycally build data validation on next cell based on possible values extracted from a column with the same name that current cell value stored in current cell col name sheet.
// In order to make this trigger work you need to add it in "Tiggers" menu at left
function onChange(e) {
tryToBuildValidationForNextCell();
return;
}
/**
* Dinamycally build data validation on next cell based on possible values extracted from a column with the same name that current cell value stored in current cell col name sheet.
*
* You have a column named/first cell "Process"
@buguibu
buguibu / .lldbinit
Created August 18, 2021 05:53
Custom LLDBINIT file with JSON printing options
# Just place it in your home directory and Xcode will load it alwys
# If you want to reload it in middle of a ebugging session just execute `command source ~/.lldbinit`
# json anyObjectContainingJson
# https://soffes.blog/debugging-json-data-in-lldb
command regex json 's/(.+)/expr let input = %1; print(String(data: try! JSONSerialization.data(withJSONObject: (input is String ? try! JSONSerialization.jsonObject(with: (input as! String).data(using: .utf8)!, options: []) : (input is Data ? (try! JSONSerialization.jsonObject(with: input as! Data, options: [])) : input as! Any)), options: [.prettyPrinted]), encoding: .utf8)!)/'
@buguibu
buguibu / setup workspace
Last active December 16, 2020 14:33
Script for open apps that conforms my workspace, with some additions, based on time & wifi
property primaryWiFiDevice : "en0"
property wfhSSID : ""
property remoteSSID : ""
on getIfWorkingHours()
set todaySeconds to (time of (current date))
return todaySeconds > 21600 and todaySeconds < 72000
end getIfWorkingHours
@buguibu
buguibu / tear down workspace
Last active August 17, 2021 15:05
Script for quit my workspace apps and end my working day in a row, it helps me to disconnect
on isRunning(appName)
tell application "System Events" to (name of processes) contains appName
end isRunning
on quitExplicitApps()
repeat with thisApp in {"Mail", "Safari", "Spotify", "Skype", "Terminal", "Toggl Track", "Xcode"}
set thisApp to thisApp as text
if isRunning(thisApp) then
@buguibu
buguibu / delete-app-simulator
Created June 19, 2020 15:11
Delete a hardcoded app from current simulator
#!/bin/bash
bundleId="com."
simulatorUUID=$(xcrun simctl list | grep Booted | awk -F"[()]" '{print $2}')
xcrun simctl terminate $simulatorUUID $bundleId
xcrun simctl uninstall $simulatorUUID $bundleId
@buguibu
buguibu / Select audio source.scpt
Created June 9, 2020 06:12
AppleScript for switch between USB audio card or headphones
#!/usr/bin/osascript
set answer to the button returned of (display dialog "Select audio source" buttons {"🔊", "🎧"} default button 2 with icon caution)
if answer = "🔊" then
selectRothMyers()
else if answer = "🎧" then
selectHeadphones()
end if
quit application "System Preferences"
//
// LineHeightLabel.swift
// LineHeightLabel
//
// Created by Shinichiro Oba on 20/06/2018.
// Copyright © 2018 bricklife.com. All rights reserved.
//
import UIKit
@buguibu
buguibu / projectXcode10.command
Last active December 3, 2019 16:11
macOS bash script for open a workspace with a specific XCode version & close
#!/bin/bash
# chmod +x projectXcode10.command
open -a /Applications/Xcode10.app "/Users/.../project.xcworkspace" --args -ApplePersistenceIgnoreState YES &
osascript -e 'quit app "Terminal"' &
#!/usr/bin/ruby
#encoding: utf-8
#Origin: https://github.com/PaulTaykalo/swift-scripts
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
class Item
def initialize(file, line, at)
@file = file
@line = line
@buguibu
buguibu / Slack script.scpt
Created June 8, 2018 15:54
Apple script Slack stuff
tell application "System Events"
tell application "Slack" to activate
key code 40 using {command down}
delay 1
-- keystroke "the_style_outlets"
keystroke "ingenieria"
delay 0.5
key code 36
delay 0.3
keystroke "Sé que os la trae al pairo, pero a mi me emociona decio esto mediante un ApplScript"