Skip to content

Instantly share code, notes, and snippets.

View davidglezz's full-sized avatar
😃
Happy

David Gonzalez davidglezz

😃
Happy
View GitHub Profile
@davidglezz
davidglezz / .gitconfig
Created February 22, 2020 10:22 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
@davidglezz
davidglezz / gitconfig.ini
Created February 22, 2020 10:21 — forked from tdd/gitconfig.ini
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = [email protected]
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
// IsValidEan13 return true if given ean13 number is valid
func IsValidEan13(code string) bool {
if len(code) != 13 {
return false
}
oddSum := 0
evenSum := 0
for i, n := range code[:12] {
digit := int(n - '0')
@davidglezz
davidglezz / README.md
Created September 28, 2017 18:58 — forked from joyrexus/README.md
Node.js streams demystified

A quick overview of the node.js streams interface with basic examples.

This is based on @brycebaril's presentation, Node.js Streams2 Demystified

Overview

Streams are a first-class construct in Node.js for handling data.

Think of them as as lazy evaluation applied to data.

@davidglezz
davidglezz / index.html
Created July 2, 2017 14:11 — forked from sandeep1995/index.html
Convert Callbacks to Promise to Async/Await
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style media="screen">
html,body{
font-family: monospace;
@davidglezz
davidglezz / post-receive
Created October 12, 2016 22:16 — forked from sergeylukin/post-receive
Git hook (post-receive): update working tree on PUSH
#!/bin/sh
#
# This hook is placed in Bare repository and it updates Working tree whenever a PUSH
# is executed
#
# Assuming following file structure:
# .
# |-- myproject
# |-- myproject.git
# set WORKTREE=../myproject
@davidglezz
davidglezz / dabblet.css
Last active September 24, 2017 12:03 — forked from LeaVerou/dabblet.css
Slanted tabs with CSS 3D transforms
/**
* Slanted tabs with CSS 3D transforms
* See http://lea.verou.me/2013/10/slanted-tabs-with-css-3d-transforms/
*/
body { padding: 50px; }
nav {
position: relative;
z-index: 1;
@davidglezz
davidglezz / FastFtol.cpp
Created June 12, 2014 19:14
Fast Float to Int conversion
inline int FastFtol(const float a)
{
static int b;
#if defined(_MSVC)
__asm fld a
__asm fistp b
#elif defined(__GNUG__)
// use AT&T inline assembly style, document that
@davidglezz
davidglezz / generateFiles.sh
Created February 11, 2014 09:04
Little script to generate 1000 folders, with 100 files each of 100kbyte.
for i in `seq 1 1000`; do
mkdir -p files-$i;
for j in `seq 1 100`; do
dd if=/dev/zero of=files-$i/$j bs=100k count=1 2> /dev/null;
done;
done
@davidglezz
davidglezz / TuentiPhotoRemove.js
Last active August 29, 2015 13:56
Tuenti Photo Delete Script :: Script que automatiza el proceso de eliminación de fotos. ¿Como se usa? Abre el album de fotos que subiste, pulsa F12 dirígete a la pestaña consola, pega el script y pulsa "Enter".
var urlFotoAnterior = "";
var interval = setInterval(function (){
try {
var urlFotoActual = document.getElementById("photo_image").getAttribute("src");
if (urlFotoActual != urlFotoAnterior)
{
urlFotoAnterior = urlFotoActual;
document.getElementById("photo-actions-remove").click();