Skip to content

Instantly share code, notes, and snippets.

View johnbahamon's full-sized avatar
Upper

John Bahamon johnbahamon

Upper
View GitHub Profile
//Formato
<script>
alert("Soy el metodo alert()");
</script>
//Variables numericas JavaScript
var numberInteger = 12345;
var numberFloat = 23.45;
var numberOctal = 0777;
var numberSciNotationUpper = .234E-2;
var numberSciNotationLower = .234e+3;
var numberHexadecimalLower = 0x456fff;
var numberHexadecimalUpper = 0x456FFF;
class LibroCalificaciones{
constructor(nombre: string){
this.establecerNombreCurso(nombre);
}
public establecerNombreCurso(nombre: string):void{
if(nombre.length<=25){
this.nombreCurso = nombre;
}
if (nombre.length>25){
this.nombreCurso = nombre.substring(0,25);
mkdir -p ~/bin
wget -O ~/bin/dropbox.py "https://www.dropbox.com/download?dl=packages/dropbox.py"
chmod +x ~/bin/dropbox.py
~/bin/dropbox.py exclude add ~/Dropbox/GitHub/widgetWeather/node_modules/
~/bin/dropbox.py exclude add ~/Dropbox/GitHub/widgetWeather/.
@johnbahamon
johnbahamon / srt-to-json.js
Created August 25, 2016 17:11 — forked from mateogianolio/srt-to-json.js
converts an SRT file into JSON
var fs = require('fs');
fs.readFile('subtitle.srt', function(error, data) {
if(error)
throw error;
var text = data.toString();
var lines = text.split('\n');
var output = [];
var Printer = require('thermalprinter');
var Raspi = require("raspi-io");
var five = require("johnny-five");
var board = new five.Board({
io: new Raspi(),
port: "/dev/ttyAMA0"
});
board.on('ready', function() {
var printer = new Printer(board);

Atajos de teclado para Eclipse (y derivados como ZendStudio)

Para editar un comando: Window → Preferences → General → Keys

Edición

Ctrl+D elimina la línea actual (en la que se encuentra el cursor)
Ctrl+Shift+F formatear código (tabulaciones, saltos de línea,…)
/* 1 */
{
"_id" : ObjectId("55e3cae6ca1b1b9858052e00"),
"name" : "Electrohogar",
"slug" : "Electrohogar",
"ancestors" : [],
"__v" : 0
}
/* 2 */
@johnbahamon
johnbahamon / categories.js
Last active August 26, 2015 03:04
Category Hierarchy
apiRouter.route('/categories')
.get(function (req, res) {
Categories.find(function (err, categories) {
if (err) res.send(err);
// return categories
res.json(categories);
});
})
// create a category (accessed at POST http://localhost:8080/api/categories)
.post(function (req, res) {