Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Fernando Lourusso dflourusso

View GitHub Profile
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"
@zshell31
zshell31 / react-native-pinch-zoom.js
Created Sep 19, 2016
React Native: how to implement pinch to zoom gesture
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) {
@dkarlovi
dkarlovi / registry.example.com.conf
Last active May 16, 2019
GitLab's Container Registry (docker) behind Apache 2.4 reverse proxy
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>
@ghinda
ghinda / object-to-form-data.js
Last active Oct 17, 2020
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
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);
@mvriel
mvriel / pre-commit.php
Created May 16, 2011
Pre-commit hook for DocBlox
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());
You can’t perform that action at this time.