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
/* Sometimes it's pretty easy to run ito troubles with React ES6 components. | |
Consider the following code: */ | |
class EventStub extends Component { | |
componentDidMount() { | |
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind | |
} | |
componentWillUnmount() { | |
window.removeEventListener('resize', this.onResize.bind(this)); |
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
#ELBにぶら下がるエンドポイントのIPを取得する | |
VAR=`aws elb describe-instance-health --load-balancer-name your-elb-name --region your-region | jq -r .InstanceStates[].InstanceId` | |
echo "${VAR}" | while read line | |
do | |
VAR2=`aws ec2 describe-instances --region your-region --instance-ids ${line} | jq -r ".Reservations[].Instances[].PrivateIpAddress"` | |
#this is IP |
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
import processing.video.*; | |
Capture capture; | |
int[] pastPixels; | |
void setup(){ | |
size(1280, 720); | |
String[] cameras = Capture.list(); | |
print(cameras[0]); | |
capture = new Capture(this, cameras[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
// JavaScript Document | |
var x1 = activeDocument.selection.bounds[0]; | |
var y1 = activeDocument.selection.bounds[1]; | |
var x2 = activeDocument.selection.bounds[2]; | |
var y2 = activeDocument.selection.bounds[3]; | |
var tmp = x1.toString() + y1.toString() + x2.toString() + y2.toString(); | |
var rect = tmp.split(' px'); |
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
perl -MEncode -pe 'Encode::from_to($_,"shiftjis","utf-8");' -i.bak text.txt |
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
perl -MHTML::Entities -ple '$_=decode_entities($_)' -i.org text01.txt |
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
^\s{2,}\n |
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
111111 | |
1111111111 | |
22223323 | |
22323332333 | |
223223332333 | |
22233332222 | |
33333333 | |
2221222 | |
22221221222 |
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
#PHPをhtml拡張子で動作・かつSSI有効 | |
AddType application/x-httpd-php .php .html | |
AddHandler application/x-httpd-php .php .html | |
AddOutputFilter INCLUDES .html | |
RewriteEngine On | |
RewriteBase / | |
#RewriteCondでURLの条件指定 |
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
if(!Array.indexOf){ | |
Array.prototype.indexOf = function(target,index){ | |
if(isNaN(index)){ | |
index = 0; | |
} | |
for(var i = index; i < target.length; i++){ | |
if(this[i] === target){ | |
return i; | |
} | |
} |
NewerOlder