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
| { | |
| "scripts": { | |
| "postinstall": "electron-rebuild", | |
| "test": "gulp test", | |
| "compile": "gulp build", | |
| "start": "npm run compile && electron main.js", | |
| "clean": "rimraf ./output", | |
| "clean:osx": "rimraf ./output/osx", |
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 A { | |
| data:string; | |
| constructor(self){} | |
| //see 'this' magic | |
| clone():this { | |
| return Object.create(this);//or use lodash or what you want; | |
| } | |
| } |
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
| //enums não são necessarios, types strings não sujam o seu JS | |
| function timeParse(date, format) { | |
| if(format === "unixparse"){ | |
| return JSON.stringify({"unixtime": date.getTime()}); | |
| } | |
| if(format === "parsetime"){ | |
| var summary = { | |
| "hour": date.getHours(), |
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 criarComponente(name, type) { | |
| var events = { | |
| 'onAfterLoad': [], | |
| }; | |
| return { | |
| url: '', | |
| load: function () { |
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
| # to install dependencies | |
| npm install | |
| # to compile and recompile to changes | |
| npm run build:watch | |
| #Use 'concurrently' when start many watchers in same time, like server+styles+preprocessors |
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 'dart:math' as Math; | |
| class Circulo { | |
| int ri; | |
| Circulo(int r){ | |
| this.ri = r; | |
| } | |
| calcularArea(int r){ |
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
| # Update Neighborhood Name | |
| router.put '/:id', (req, res) -> | |
| Neighborhoods = req.app.components.neighborhoods['neighborhoods.model'] | |
| params = { | |
| _id: req.params.id | |
| } | |
| Neighborhoods |
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 to console": { | |
| "prefix": "log", | |
| "body": [ | |
| "console.log('$1');", | |
| "$2" | |
| ], | |
| "description": "Log output to console" | |
| }, | |
| "Simple function":{ |
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 reg = /"IPhone 6": .+;/g; | |
| var str = '{asdasdasd; "IPhone 6": weqweq; "asdasda":"asdasdas"}' | |
| str.match(reg) | |
| //[""IPhone 6": weqweq;"] | |
| var resul = str.match(reg)[0].replace("\"IPhone 6\":", "").replace(";", "") | |
| resul | |
| //" weqweq" |
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
| __author__ = 'Abraao Alves' | |
| import sys | |
| class Calc(): | |
| def __init__(self, num1, num2): | |
| self.num1 = num1 | |
| self.num2 = num2 |