View deps.js
// 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" |
View react-native-pinch-zoom.js
/** 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) { |
View registry.example.com.conf
<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> |
View object-to-form-data.js
// 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) { |
View soma.php
<?php | |
$notas = [ | |
999 => 8, | |
456 => 3, | |
789 => 5, | |
123 => 2, | |
]; // 8 5 3 2 | |
asort($notas); |
View pre-commit.php
#!/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()); |