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
// este é o único arquivo que faz import externo | |
// assim as dependências ficam centralizadas em um único local | |
// também fica explício exatamente qual função está sendo utilizada de cada módulo | |
export * as v4 from "https://deno.land/std/uuid/v4.ts" | |
export { red } from "https://deno.land/std/fmt/colors.ts" |
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
/** Links: | |
* - http://stackoverflow.com/questions/36368919/scrollable-image-with-pinch-to-zoom | |
* - http://blog.lum.pe/gesture-detection-in-react-native-fixing-unexpected-panning/ | |
* | |
*/ | |
import React, {Component, PropTypes} from 'react'; | |
import { Text, View, PanResponder, Image } from 'react-native'; | |
function calcDistance(x1, y1, x2, y2) { |
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
<VirtualHost *:80> | |
ServerName registry.example.com | |
ServerSignature Off | |
RewriteEngine on | |
RewriteCond %{HTTPS} !=on | |
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L] | |
</VirtualHost> | |
<VirtualHost *:443> |
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
// takes a {} object and returns a FormData object | |
var objectToFormData = function(obj, form, namespace) { | |
var fd = form || new FormData(); | |
var formKey; | |
for(var property in obj) { | |
if(obj.hasOwnProperty(property)) { | |
if(namespace) { |
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
<?php | |
$notas = [ | |
999 => 8, | |
456 => 3, | |
789 => 5, | |
123 => 2, | |
]; // 8 5 3 2 | |
asort($notas); |
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
#!/usr/bin/php | |
<?php | |
echo PHP_EOL; | |
// output a little introduction | |
echo '>> Starting unit tests' . PHP_EOL; | |
// get the name for this project; probably the topmost folder name | |
$projectName = basename(getcwd()); |