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
More docs - https://sonos.svrooij.io/services/rendering-control#setrelativevolume | |
Get IP Address from your Sonos App - Settings -> General Settings -> About you system | |
// Set Relative Volume | |
curl -X POST "http://192.168.XXX.XXX:1400/MediaRenderer/RenderingControl/Control" \ | |
-H "SOAPACTION: \"urn:schemas-upnp-org:service:RenderingControl:1#SetRelativeVolume\"" \ | |
-H "Content-Type: text/xml; charset=utf-8" \ | |
--data '<?xml version="1.0"?> | |
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> |
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
from flask import Blueprint, redirect, request, session, render_template | |
from spotipy.oauth2 import SpotifyOAuth | |
import spotipy | |
import random | |
# Spotify credentials | |
SPOTIPY_CLIENT_ID = "your client id" | |
SPOTIPY_CLIENT_SECRET = "your secret" | |
SPOTIPY_REDIRECT_URI = "http://localhost:5000/spotify/callback" |
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
# ag <https://github.com/ggreer/the_silver_searcher> | |
# requires ag -> brew install the_silver_searcher | |
# usage: ag-replace.sh [search] [replace] | |
# caveats: will choke if either arguments contain a forward slash | |
# notes: will back up changed files to *.bak files. Remove the second line if you'd like to keep them | |
ag -0 -l $1 | xargs -0 sed -ri.bak -e "s/$1/$2/g"; | |
git clean -f '**/*.bak'; |
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 | |
# brew install the_silver_searcher https://github.com/ggreer/the_silver_searcher | |
# Add this script somewhere, and update permissions: chmod +x find_unused_keys.sh | |
# usage: ./find_unused_keys.sh keys.csv [optional: /path/to/search/] | |
# column 1 should be the key, column 2 should be the team name | |
CSV_FILE=$1 |
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
-- Project forked from existing repair mod https://steamcommunity.com/sharedfiles/filedetails/?id=2852867235&searchtext=better+repair | |
-- Docs https://projectzomboid.com/modding/zombie/characters/package-summary.html | |
local ISFixAction_perform = ISFixAction.perform | |
-- Random chance to return true if the repair counter should be frozen (e.g. this item can no longer break) | |
local function shouldFreezeRepairCount() | |
local chance = SandboxVars.PRM.stopCounterChance | |
if chance == 0 then return false end | |
local a = ZombRand(0, 101) | |
local b = 100 - chance |
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
/** | |
* Shake a view with a preset cycle interpolater | |
* | |
* @param view | |
* the view to shake | |
*/ | |
public static void shakeIt(final View view) { | |
if (view != null) { | |
Animation shakeAnimation = new TranslateAnimation(0, 10, 0, 0); | |
shakeAnimation.setDuration(300); |
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
https://drive.google.com/file/d/0B31CyA6eg0M6NU9sNWpxMkJham8/edit?usp=sharing |
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
<!-- | |
Copyright (C) 2014 Google Inc. All Rights Reserved. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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 static void removeAllViews(final ViewGroup viewGroup) { | |
while (viewGroup.getChildCount() != 0) { | |
boolean childrenHaveChildren = false; | |
for (int i = 0; i < viewGroup.getChildCount(); i++) { | |
final View child = viewGroup.getChildAt(i); | |
if (child instanceof ViewGroup) { |
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
/** | |
* Converts a DP value to a PX value. | |
* | |
* @param context | |
* the context to use. | |
* @param dp | |
* the DP value to convert. | |
* @return the converted PX value. | |
*/ | |
public static int getPxFromDp(Context context, float dp) { |
NewerOlder