Skip to content

Instantly share code, notes, and snippets.

View brunormferreira's full-sized avatar
:octocat:
coding and learning

Bruno Ramires brunormferreira

:octocat:
coding and learning
View GitHub Profile
@ryanflorence
ryanflorence / static_server.js
Last active April 26, 2024 16:18
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@garystorey
garystorey / pxtorem.scss
Last active November 9, 2023 16:34
Sass to convert px to rem
/**
* Convert font-size from px to rem with px fallback
*
* @param $size - the value in pixel you want to convert
*
* e.g. p {@include fontSize(12px);}
*
*/
@use "sass:math";
@berzniz
berzniz / jshipster_and_and.js
Last active May 22, 2022 23:15
Some small javascript hacks for hipsters
// Boring
if (isThisAwesome) {
alert('yes'); // it's not
}
// Awesome
isThisAwesome && alert('yes');
// Also cool for guarding your code
var aCoolFunction = undefined;
# include <stdio.h>
# include <string.h>
# include <ctype.h>
# include <stdlib.h>
// Programa agenda.c
typedef struct
{
char nome[31];
@leocomelli
leocomelli / git.md
Last active May 7, 2024 00:45
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

# NPM CheatSheet.
# Super easy intall: npm comes with node now.
# To create your own npm package: https://www.npmjs.org/doc/misc/npm-developers.html
# More: https://www.npmjs.org/doc/
# 1. NPM Command Lines.
# Local mode is the default.
# Use --global or -g on any command to operate in global mode instead.
@dedunumax
dedunumax / .gitignore Java
Last active May 7, 2024 17:07
A complete .gitignore file for Java.
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*
@garystorey
garystorey / fadein.js
Created January 5, 2015 21:53
fadeIn.js
Element.prototype.fadeIn = function(callback) {
var ele = this,
opacity = ele.style.opacity = ele.style.opacity || 0.0,
fadeInLoop = null,
intervalTime = 10,
opacityAmount = 0.05;
ele.style.display = 'block';
// If the opacity is already greater than or equal to zero then there is nothing
function on(elSelector, eventName, selector, fn) {
var element = document.querySelector(elSelector);
element.addEventListener(eventName, function(event) {
var possibleTargets = element.querySelectorAll(selector);
var target = event.target;
for (var i = 0, l = possibleTargets.length; i < l; i++) {
var el = target;
var p = possibleTargets[i];