- open -a Xquartz
- export DISPLAY=192.168.1.x:0
- xhost + 192.168.1.x
- -e DISPLAY=192.168.1.x:0
This file contains hidden or 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
UIPopoverPresentationController *popPresenter = ac.popoverPresentationController; | |
popPresenter.sourceView = self.view; | |
popPresenter.sourceRect = CGRectMake(CGRectGetMidX(self.view.bounds), CGRectGetMidY(self.view.bounds),0,0); | |
popPresenter.permittedArrowDirections = 0; |
This file contains hidden or 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
####### STEP 1 | |
cd local | |
openssl genrsa -out keyfile.key 4096 | |
openssl rsa -in keyfile.key -pubout -out keyfile.pub | |
cp keyfile.pub ../remote/ | |
####### STEP 2 -Encrypt | |
#!/bin/bash | |
file=$1 |
This file contains hidden or 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
# 1. Inside Websites And Domains & > Apache & nginx Settings | |
<Directory "/var/www/vhosts/sfmobile.it/devtat.sfmobile.it"> | |
SetEnvIf Request_URI "frontend_cro/img/email-template" allowed_restricted | |
Order Deny,Allow | |
Deny from all | |
Allow from env=allowed_restricted | |
Satisfy any | |
</Directory> |
This file contains hidden or 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
### SHORT WAY | |
DELETE n1 FROM names n1, names n2 WHERE n1.id > n2.id AND n1.name = n2.name | |
### FAST WAY | |
-- Create temporary table | |
CREATE TABLE temp_table LIKE table1; | |
-- Add constraint | |
ALTER TABLE temp_table ADD UNIQUE(category, image_set_id); |
This file contains hidden or 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
AFHTTPSessionManager *sessionManager = [AFImageDownloader defaultInstance].sessionManager; | |
sessionManager.securityPolicy.allowInvalidCertificates = YES; | |
sessionManager.securityPolicy.validatesDomainName = NO; |
This file contains hidden or 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
int index = rgModalita.indexOfChild(rgModalita.findViewById(rgModalita.getCheckedRadioButtonId())); |
This file contains hidden or 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
var text = "<span style='color:red'>text to check</span>" | |
let attrStr = try! NSMutableAttributedString( | |
data: text.data(using: .unicode, allowLossyConversion: true)!, | |
options: [ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: String.Encoding.utf8.rawValue], | |
documentAttributes: nil) | |
let range = NSRange(location: 0, length: attrStr.length) | |
attrStr.addAttribute(NSFontAttributeName, value: font!, range: range) |
This file contains hidden or 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
RecyclerViewSwipeHelper swipeHelper = new RecyclerViewSwipeHelper(this, listView) { | |
@Override | |
public void instantiateUnderlayButton(RecyclerView.ViewHolder viewHolder, List<UnderlayButton> underlayButtons) { | |
underlayButtons.add(new RecyclerViewSwipeHelper.UnderlayButton( | |
"Delete", | |
0, | |
Color.parseColor("#FF3C30"), | |
new RecyclerViewSwipeHelper.UnderlayButtonClickListener() { | |
@Override | |
public void onClick(int pos) { |
This file contains hidden or 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
<script type="text/javascript" src="http://mywebsite.com/widgets/initial.js"></script> | |
<div id="mywebsite-container"></div> |