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
deleteEmptyProps(obj: any): any { | |
// modifies passed obj in place, removing empty properties (inc. empty arrays) | |
return Object.keys(obj).forEach(k => { | |
if (!obj[k] || obj[k] === undefined || | |
Array.isArray(obj[k]) && obj[k].length === 0) { | |
delete obj[k]; | |
} | |
}); | |
} |
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 logging | |
import socket | |
log = logging.getLogger('udp_server') | |
def udp_server(host='127.0.0.1', port=1234): | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 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
# apt-get install | |
sudo apt-get update | |
# For ubuntu 14.04 | |
sudo apt-get install -y xserver-xorg-video-dummy-lts-trusty | |
# For ubuntu 16.04 | |
sudo apt-get install -y xserver-xorg-video-dummy-lts-willy | |
# Copy the xorg.conf to `/etc/X11/xorg.conf`. | |
wget -P /etc/X11 https://gist.githubusercontent.com/mangoliou/ba126832f2fb8f86cc5b956355346038/raw/b6ad063711226fdd6413189ad905943750d64fd8/xorg.conf |
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
// FIT LAYER TO CANVAS | |
// via https://forums.adobe.com/message/5413957#5413957 | |
var maintainAspectRatio = true; // set to true to keep aspect ratio | |
if (app.documents.length>0){ | |
app.activeDocument.suspendHistory ('Fit Layer to Canvas', 'FitLayerToCanvas('+maintainAspectRatio+')'); | |
} | |
function FitLayerToCanvas(keepAspect) { |
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
sudo echo "Acquire::ForceIPv4 \"true\";" > /etc/apt/apt.conf.d/99force-ipv4 |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<system.web> | |
<httpRuntime maxQueryStringLength="32768" maxUrlLength="65536"/> | |
</system.web> | |
<system.webServer> | |
<security> | |
<requestFiltering> | |
<requestLimits maxQueryString="32768"/> | |
</requestFiltering> |