Skip to content

Instantly share code, notes, and snippets.

View dflourusso's full-sized avatar

Daniel Fernando Lourusso dflourusso

  • Maringá - PR - Brasil
View GitHub Profile
// 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"
@zshell31
zshell31 / react-native-pinch-zoom.js
Created September 19, 2016 13:32
React Native: how to implement pinch to zoom gesture
/** 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) {
@dkarlovi
dkarlovi / registry.example.com.conf
Last active February 7, 2024 19:38
GitLab's Container Registry (docker) behind Apache 2.4 reverse proxy
<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>
@ghinda
ghinda / object-to-form-data.js
Last active September 17, 2024 05:22
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// 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) {
<?php
$notas = [
999 => 8,
456 => 3,
789 => 5,
123 => 2,
]; // 8 5 3 2
asort($notas);
@mvriel
mvriel / pre-commit.php
Created May 16, 2011 20:14
Pre-commit hook for DocBlox
#!/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());