- Um nível de recuo por método.
- Não use a palavra-chave ELSE.
- Envolver todos os primitivos e Strings em classes. (em JS nao eh necessario)
- Funções de primeira classe // mudei p/ Function em vez de Class
- Um ponto por linha.
- Não abrevie.
- Mantenha todas os módulos com menos de 50 linhas.
- Nenhuma função com mais de dois parâmetros.
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
<form method="post" action="upload.php" enctype="multipart/form-data"> | |
<input name='uploads[]' type="file" multiple> | |
<input type="submit" value="Send"> | |
</form> | |
<?php | |
/*upload*/ | |
foreach ($_FILES['uploads']['name'] as $filename) { | |
echo '<li>' . $filename . '</li>'; |
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 ffmpeg = require('ffmpeg'); | |
try { | |
var process = new ffmpeg('example.mp4'); | |
process.then(function (video) { | |
console.log('The video is ready to be processed'); | |
var watermarkPath = 'watermark-suissa.png', | |
newFilepath = './video-com-watermark.mp4', | |
settings = { | |
position : "SE" // Position: NE NC NW SE SC SW C CE CW |
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
-export([uptime/0, uptime/1, uptime_string/0]). | |
%% @doc uptime in native time units | |
uptime() -> | |
erlang:monotonic_time() - erlang:system_info(start_time). | |
%% @doc uptime in specified time units | |
uptime(Unit) -> | |
erlang:convert_time_unit(uptime(), native, Unit). |
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
// Closure | |
(function() { | |
/** | |
* Decimal adjustment of a number. | |
* | |
* @param {String} type The type of adjustment. | |
* @param {Number} value The number. | |
* @param {Integer} exp The exponent (the 10 logarithm of the adjustment base). | |
* @returns {Number} The adjusted value. | |
*/ |
All you have to do, to extend your trial period, is change number in TrialKey element in application.xml. This file is located in /Library/Application Support/Adobe/Adobe Photoshop/AMT. You can navigate there with this command:
cd /Library/Application\ Support/Adobe/Adobe\ Photoshop\ */AMT
Then you have to open the file and edit it. You can use just TextEdit app.
open -a TextEdit application.xml
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 trampoline(f) { | |
return function trampolined(...args) { | |
let result = f.bind(null, ...args); | |
while (typeof result === 'function') result = result(); | |
return result; | |
}; | |
} |
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 trampoline(f) { | |
return function trampolined(...args) { | |
let result = f.bind(null, ...args); | |
while (typeof result === 'function') result = result(); | |
return result; | |
}; | |
} |
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
// Discord all events! | |
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!) | |
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client | |
// Learn from this, do not just copy it mofo! | |
// | |
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584 | |
/* | |
koad-was-here |
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 mongoose = require('mongoose'); | |
var BeerSchema = new mongoose.Schema({ | |
id: { type: Number, min: 0}, | |
name: { type: String, default: '' }, | |
description: { type: String, default: '' }, | |
abv: { type: Number, min: 0}, | |
category: { type: String, default: ''}, | |
created_at: { type: Date, default: Date.now }, | |
updated_at: { type: Date, default: Date.now } |
NewerOlder