curl --request POST \ --url http://receiver-ip/YamahaRemoteControl/ctrl \ --header 'Content-Type: Content-Type text/xml; charset="utf-8"' \ --data '<YAMAHA_AV cmd="PUT"><Main_Zone><Sound_Video><Tone><Bass><Val>0</Val><Exp>1</Exp><Unit>dB</Unit></Bass></Tone></Sound_Video></Main_Zone></YAMAHA_AV>'
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
*BSD/Darwin (macOS): | |
LC_ALL=C sed -i '' '/porn/d' $HISTFILE | |
Linux (GNU sed): | |
LC_ALL=C sed -i '/porn/d' $HISTFILE | |
This will remove all lines matching "porn" from your $HISTFILE. | |
With setopt HIST_IGNORE_SPACE, you can prepend the above command with a space character to prevent it from being written to $HISTFILE. |
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
add_header Content-Security-Policy "default-src 'none'; base-uri 'self'; media-src 'self'; img-src 'self' https://s.w.org https://wordpress.org https://ps.w.org data:; font-src 'self' data:; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' ; style-src 'self' 'unsafe-inline'; connect-src 'self' wss://*.selfhostname.org; form-action 'self'; frame-ancestors 'self' *.validhosttoembedthissite.org; frame-src 'self' ; upgrade-insecure-requests;" always; | |
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 | |
# thank you publicarray for the main work - this script is just a minor adaption | |
set -e | |
if ! command -v dashing >/dev/null 2>&1; then | |
if command -v go >/dev/null; then | |
brew install dashing | |
else | |
echo "Missing go. Install golang first 'brew install golang'" |
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 f in *.m4a; do ffmpeg -i "$f" -b:a 256K -map a "${f%.m4a}.mp3"; done |
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
/** | |
* The alpha is changed step by step in order of array | |
* @param duration the duration of the animations for each view | |
*/ | |
- (void)animateAlphaForViews:(NSArray *)views to:(CGFloat)alpha duration:(CGFloat)duration | |
{ | |
if (views.count > 0) { | |
UIView *view = views.firstObject; | |
NSMutableArray *newViews = [views mutableCopy]; |
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
# Get the commit count | |
GIT_COMMIT_COUNT=`git rev-list --all | wc -l | tr -d ' '` | |
#copy template to settingsbundle | |
bundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
#update Root.plist in settingsbundle with current version and build number | |
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:0:DefaultValue $bundleVersion (build $GIT_COMMIT_COUNT)" "${PROJECT_DIR}"/Settings.bundle/Root.plist |
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 <UIKit/UIKit.h> | |
@interface DAMCustomViewController : UIViewController | |
//Enforce calling super | |
- (void)viewWillAppear:(BOOL)animated __attribute__((objc_requires_super)); | |
- (void)viewDidAppear:(BOOL)animated __attribute__((objc_requires_super)); | |
- (void)viewWillDisappear:(BOOL)animated __attribute__((objc_requires_super)); | |
- (void)viewDidDisappear:(BOOL)animated __attribute__((objc_requires_super)); | |
- (void)viewDidLoad __attribute__((objc_requires_super)); |
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 <QuartzCore/QuartzCore.h> | |
@implementation CustomTableViewController | |
-(void)setSelectionViewForCell:(UITableViewCell*)cell withRoundedRectCorners:(UIRectCorner)rectCorners | |
{ | |
CGRect cellRect = CGRectMake(0, 0, cell.bounds.size.width-18, cell.bounds.size.height); | |
UIView *view = [[UIView alloc] initWithFrame:cellRect]; | |
if (rectCorners != 0) { //we need rounded corners, beginning or end of a tableViewSection |