Skip to content

Instantly share code, notes, and snippets.

View cpavnn's full-sized avatar

Pavan C cpavnn

  • Shell
  • Bangalore
View GitHub Profile
//Open powershell
//Change the directory to the target folder
Get-ChildItem | % {$_.LastWriteTime = '01/01/2020 06:00:00'}
<apex:page >
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script language="javascript" type="text/javascript">
var wsUri = "wss://echo.websocket.org/";
var output;
function init()
module.exports = app => {
app.log('The app was loaded!')
app.on('issues.opened', async context => {
const params = context.repo({path: 'doc/file.json'});
var result = await context.github.repos.getContents(params);
var contents = Buffer.from(result.data.content, 'base64').toString();
@cpavnn
cpavnn / getAttributesFromLightningTags
Created July 31, 2018 12:34
Lightning get element attributes for lightning tags
// Instead of getElementById or getElementsByClassName
var elements = component.find("details");
console.log('eve',elements);
elements.forEach(function(element) {
element.getElement().style.background = 'green' ;
});
@cpavnn
cpavnn / imgTagFromHTML
Last active July 31, 2018 12:25
Extract tags values from html (HTML is in form of a string)
var url = "<img height=\"100\" src=\"data:image/png;base64,testurlhere\" width=\"200\"></img>";
var tmp = document.createElement('div');
tmp.innerHTML = url;
var src = tmp.querySelector('img').getAttribute('src');
snippet.log(src)
func: function() {
btn.onclick = this.method1(param);
}
method1: function(param) {
return function() {
console.log(param);
}
}
@cpavnn
cpavnn / .travis.yml
Last active March 6, 2019 19:02
Travis yml file for Firebase
language: node_js
node_js:
- "7"
script:
- echo "Deploy!!"
install:
- npm install -g firebase-tools
after_success:
- firebase deploy --project projectId --token $FIREBASE_TOKEN