Skip to content

Instantly share code, notes, and snippets.

View gustavomdsantos's full-sized avatar
👨‍💻
Working as an IT manager

Gustavo Moraes gustavomdsantos

👨‍💻
Working as an IT manager
  • Universidade Federal de Goiás
  • Brasília, Distrito Federal
View GitHub Profile
@camiloribeiro
camiloribeiro / triangle.feature
Created February 15, 2012 04:17
Simple cucumber example in Portuguese
#language: pt
Funcionalidade: Leitor de tipos de Triângulo
Para conhecer o tipo de um triângulo
Como um aluno da matemática
Eu quero informar os tamanhos do lado de um triângulo e saber qual o tipo do triângulo
NARRATIVA
Um triângulo com todos os lados iguais é chamado Equilátero
@AndreasBriese
AndreasBriese / underscoreAddon.js
Created January 24, 2012 14:45
underscore addon -> sum, mean, median, nrange
// underscore addon with sum, mean, median and nrange function
// see details below
_.mixin({
// Return sum of the elements
sum : function(obj, iterator, context) {
if (!iterator && _.isEmpty(obj)) return 0;
var result = 0;
if (!iterator && _.isArray(obj)){
@anaisbetts
anaisbetts / stat-cache.js
Last active April 11, 2019 05:07
Make your Electron apps load faster, with this One Weird Trick
// Include this at the very top of both your main and window processes, so that
// it loads as soon as possible.
//
// Why does this work? The node.js module system calls fs.realpathSync a _lot_
// to load stuff, which in turn, has to call fs.lstatSync a _lot_. While you
// generally can't cache stat() results because they change behind your back
// (i.e. another program opens a file, then you stat it, the stats change),
// caching it for a very short period of time is :ok: :gem:. These effects are
// especially apparent on Windows, where stat() is far more expensive - stat()
// calls often take more time in the perf graph than actually evaluating the
@lingceng
lingceng / form_submit.js
Last active October 31, 2020 00:19
JavaScript request like a form submit
// http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit
// form_submit('/contact/', {name: 'Johnny Bravo'});
function form_submit(path, params, method) {
method = method || "post"; // Set method to post by default if not specified.
// The rest of this code assumes you are not using a library.
// It can be made less wordy if you use one.
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);
@kirilloid
kirilloid / jsPrimitiveCompare
Last active August 27, 2022 04:59
JavaScript primitive (non-strict) comparison table
// italics for objects
(function (values) {
function toString(x) {
var v = x;
v = (v || v === "") ? JSON.stringify(v) : String(v);
if (typeof x === 'object') v = v.italics();
return v;
}
function describe (i,j) {
var v1 = values[i],
@janmoesen
janmoesen / .bash_profile
Created August 19, 2011 06:01
Temporary .bash_profile
# ============== shell
# Case-insensitive globbing.
shopt -s nocaseglob;
# Do not overwrite files when redirecting using ">", ">&" or "<>".
# Note that you can still override this with ">|".
set -o noclobber;
# UTF-8 all the way.
export LC_ALL='en_GB.UTF-8';
@denilsonsa
denilsonsa / README.md
Last active August 15, 2023 05:01 — forked from noromanba/README.md
add permanently HEAD links on Gist for UserScript
anonymous
anonymous / activity_main.xml
Created April 8, 2015 22:18
RelativeLayout XML for Udacity quiz question
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<TextView
android:text="I’m in this corner"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
@deshack
deshack / roboto-condensed.css
Last active September 9, 2023 08:24
Add Roboto Condensed to your project with @font-face CSS rule. See http://deshack.net/use-roboto-condensed-font-face-css-rule/ for a complete and detailed tutorial.
/**
* Include Roboto Condensed font in your project
*
* Download Roboto Condensed ttf files from Google Fonts and place it in the same directory of this CSS file
* You can then use this font in your project by setting
* font-face: "Roboto Condensed", Helvetica, Arial, sans-serif;
*
* @author Mattia Migliorini (deshack)
* @license MIT
*/
@LeoIannacone
LeoIannacone / monokai-exteded.xml
Last active October 26, 2023 15:50
Monokai Extended - GtkSourceView Theme
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2014 Leo Iannacone <info@leoiannacone.com>
This file was generated from a textmate theme named Monokai Extended
with tm2gtksw2 tool. (Alexandre da Silva)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either