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
$original = array | |
( | |
"1" => array | |
( | |
"id" => 1, | |
"type" => "mtb", | |
"brand" => "scott", | |
"name" => "scott1" | |
), | |
array |
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
-- Modified script, based on: | |
-- http://peterdowns.com/posts/open-iterm-finder-service.html | |
on run {input, parameters} | |
tell application "Finder" | |
set dir_path to quoted form of (POSIX path of (folder of the front window as alias)) | |
end tell | |
CD_to(dir_path) | |
end run |
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/sh | |
# | |
# | |
# Usage: ./scriptName.sh www.google.com | |
# | |
ADDRESS=$1 | |
echo Fetching ssl certificate for $ADDRESS |
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
on alfred_script(q) | |
tell application "iTerm" | |
activate | |
tell the first terminal | |
launch session "Default" | |
tell the last session | |
-- give the iterm tab the name of the process | |
set name to q |
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 | |
# get all running docker container names | |
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}') | |
host=$(hostname) | |
# loop through all containers | |
for container in $containers | |
do | |
echo "Container: $container" |
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 | |
####################################################### | |
## Simple bash script to change OSX network location ## | |
## based on the wifi network you're connected too. ## | |
## Author: Rob Sonke ## | |
####################################################### | |
# | |
# NOTE: Make sure you add this line to the /etc/sudoers file to allow |
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
# Given a collection of image files, this function will resize | |
# the images in the current folder and saves them in the subfolder resized | |
# | |
# Usage: resize-images | |
# Note: the read command is specific for ZSH shells, for Bash, use -p param. Same for the setopt, it's shopt for bash. | |
# | |
## Resize and rename images in the current directory and writes them to a resized subfolder | |
function resize-images() { | |
read "filename?What would you like the filename to be started with? []: " | |
read "width?What max width in pixels would you like your images? [1024]: " |
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
import getpass | |
import json | |
import re | |
import requests | |
client_id = re.compile(',client_id:"(.*?)"').search(requests.get(re.compile('src="https://a-v2.sndcdn.com/assets/app-.*.js"').search(requests.get('https://soundcloud.com/').text).group()[5:-1]).text).group()[12:-1] | |
username = raw_input('Username: ') | |
password = getpass.getpass() |
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/sh | |
############################################# | |
## Bash script to cleanup git repositories ## | |
## Author: Rob Sonke ## | |
############################################# | |
# To execute this in all subdirs of the current dir: | |
# for d in ./* | |
# do | |
# (cd $d && ~/Downloads/removeOldBranches.sh) |
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 | |
# | |
# Simple Bash script to fix a merge conflict with either mine or yours as option | |
# | |
# @author R. Sonke | |
# | |
bold=$(tput bold) | |
normal=$(tput sgr0) | |
doTheMerge () { |
OlderNewer