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
//add this to your package.json | |
// "audio-buffer-utils": "^5.1.2", | |
// "audio-decode": "^1.4.0", | |
// "audiobuffer-to-wav": "^1.0.0", | |
// "node-lame": "^1.2.0", | |
// "ogg.js": "^0.1.0", | |
// "opus.js": "^0.1.1", | |
const fs = require('fs'); |
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
<? | |
print "<h1>Hello world</h1>\n"; | |
print "A simple counter:<br>\n"; | |
for($i=0;$i<10;$i++) { | |
print $i."<br>\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
/** | |
* | |
*/ | |
class ExecPHP { | |
/** | |
* | |
*/ | |
constructor() { | |
this.phpPath = 'C:\\Users\\Martin\\Desktop\\Dropbox\\Mediumprojects\\phpinnode\\php\\php.exe'; | |
this.phpFolder = ''; |
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 express = require('express'); | |
var app = express(); | |
var execPHP = require('./execphp.js')(); | |
execPHP.phpFolder = 'C:\\Users\\Martin\\Desktop\\Dropbox\\Mediumprojects\\phpinnode\\phpfiles\\'; | |
app.use('*.php',function(request,response,next) { | |
execPHP.parseFile(request.originalUrl,function(phpResult) { | |
response.write(phpResult); |
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
// This will stop the application and give you a nice "ReferenceError: test is not defined" | |
test = 'hello'; | |
console.log(test); | |
// This is the way to do it, by defining the variable using "var" | |
var test = 'hello'; | |
console.log(test); |
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
function Person() { | |
this.id = 'id_1'; | |
} | |
Person.prototype.setName = function(name) { | |
this.name = name.charAt(0).toUpperCase() + name.slice(1); | |
}; | |
Person.prototype.sayHello = function() { | |
console.log('Hello, my name is ' + this.name + ', I have ID: ' + this.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
class Person { | |
constructor() { | |
this.id = 'id_1'; | |
} | |
set name(name) { | |
this._name = name.charAt(0).toUpperCase() + name.slice(1); | |
} | |
get name() { | |
return this._name; | |
} |
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
atom.workspace.onDidChangeActivePaneItem(function(editor) { | |
var tabs = document.getElementsByClassName('tab'); | |
for(var i=0;i<tabs.length;i++) { | |
var fileName = tabs[i].childNodes[0].getAttribute('data-name'); | |
var ext = fileName.substr(fileName.lastIndexOf('.') + 1); | |
var className = 'filetype_' + ext; | |
if (!tabs[i].classList.contains(className)) { | |
tabs[i].classList.add(className); | |
} |