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
BUCKET_NAME=YOUR_BUCKKET_NAME | |
KEY_PREFIX="folder/to/restore" | |
# list all files having deleteMarker as latest version, you may use to confirm versionid. | |
aws s3api list-object-versions --bucket $BUCKET_NAME --prefix $KEY_PREFIX --query 'DeleteMarkers[?IsLatest==`true`]' | |
# this will actually restore all files by deleting delete marker from deleted files. | |
aws s3api list-object-versions --bucket $BUCKET_NAME --prefix $KEY_PREFIX --output json --query 'DeleteMarkers[?IsLatest==`true`].[Key, VersionId]' | jq -r '.[] | "--key '\''" + .[0] + "'\'' --version-id " + .[1]' | xargs -L1 aws s3api delete-object --bucket $BUCKET_NAME |
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
stages: | |
- deploy | |
deploy_production: | |
stage: deploy | |
script: | |
- npm install | |
- npm run build --prod | |
- echo "Deploy to Production server" | |
- aws s3 sync ./dist s3://$BUCKETNAME/ --acl=public-read --delete |
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
{ | |
"Version": "2012-10-17", | |
"Id": "PublicBucketPolicy", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1482880670019", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::BUCKETNAME/*" |
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
# Powershell script to list all files (including sub directory) under particular directory and remove last line out of it. | |
Get-ChildItem ".\" -Recurse -Filter *.txt | | |
Foreach-Object { | |
$lastline = Get-Content $_.FullName | select -Last 1 | |
if ($lastline -like 'findsomestring') { | |
$test = Get-Content $_.FullName | |
$output = $test[0..($test.count - 2)] | |
Set-Content -Path $_.FullName -Value $output | |
} |
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
function dpToPixel(dp) { | |
return ( parseInt(dp) * (Titanium.Platform.displayCaps.dpi / 160)); | |
} | |
// convert pixel to dp. | |
function pixelToDp(px,nounit) { | |
return ( parseInt(px) / (Titanium.Platform.displayCaps.dpi / 160)) + (nounit?0:'dp'); | |
} | |
var reArrangeLable = function(){ |
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
<cfscript> | |
rc.date = "Mon Feb 29 2016 00:00:00 GMT+0530 (IST)"; | |
rc.date1 = DateAdd("s", 0, rc.date); | |
WriteDump(var=rc); //Converted to {ts '2016-02-28 22:00:00'} instead of {ts '2016-02-28 18:30:00'} | |
rc.date = "Mon Feb 29 2016 00:00:00 GMT+0430 (AFT)"; | |
rc.date1 = DateAdd("s", 0, rc.date); | |
WriteDump(var=rc); | |
</cfscript> |
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
<cfmail to="[email protected]" from="[email protected]" subject = "Email with attachment" type="text"> | |
<cfmailparam file="C:\Inetpub\wwwroot\worklog.pdf"> | |
<cfmailpart type="html"> | |
<p>Html Email content goes here </p> | |
</cfmailpart> | |
</cfmail> |
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
<cfmail to="[email protected]" from="[email protected]" subject = "Email with attachment" type="html"> | |
<cfmailparam file="C:\Inetpub\wwwroot\worklog.pdf"> | |
Email body will goes here. | |
</cfmail> |
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
var casper = require('casper').create(); | |
casper.start('http://www.isummation.com/', function() { | |
this.echo(this.getTitle()); | |
}); | |
casper.run(); |
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
component output="false" singleton{ | |
// Default Action | |
property name="masterService" inject="entityService:tmaster" scope="variables"; | |
property name="detailService" inject="entityService:tdetail" scope="variables"; | |
function index(event,rc,prc){ | |
var masterbean = masterService.new({col1:"master"}); | |
var detailbean = detailService.new({col2:"detail"}); | |
/* save with master bean |
NewerOlder