Skip to content

Instantly share code, notes, and snippets.

View rafaell-lycan's full-sized avatar
💣
(╯°□°)╯ ︵ ┻━┻

Rafaell Lycan rafaell-lycan

💣
(╯°□°)╯ ︵ ┻━┻
View GitHub Profile
@rafaell-lycan
rafaell-lycan / prevent-enter-submit.js
Created January 28, 2015 22:28
AngularJS - Prevent Enter Submit Directive
angular.module('app',[])
.directive('preventEnterSubmit', function () {
return function (scope, el, attrs) {
el.bind('keydown', function (event) {
if (13 == event.which) {
event.preventDefault(); // Doesn't work at all
window.stop(); // Works in all browsers but IE...
document.execCommand('Stop'); // Works in IE
return false; // Don't even know why it's here. Does nothing.
}
@rafaell-lycan
rafaell-lycan / keybase.md
Created August 10, 2020 21:39
keybase.md

Keybase proof

I hereby claim:

  • I am rafaell-lycan on github.
  • I am rafaell (https://keybase.io/rafaell) on keybase.
  • I have a public key ASCxOpy3ePX9eoIE39worlSlJh8tOO_cBZzJXZSXZm1_pgo

To claim this, I am signing this object:

@rafaell-lycan
rafaell-lycan / App.jsx
Last active July 10, 2020 01:52
Source code for implementing a React <Tabs/> component.
import React from 'react';
import { render } from 'react-dom';
import Tabs from './Tabs';
const App = () => {
return (
<Tabs>
<Tabs.Tab label={'Tab 1'}>
<p>Content 1</p>
</Tabs.Tab>
@rafaell-lycan
rafaell-lycan / readme.md
Created November 4, 2019 11:06
Node Microservice architecture example

Node Microservice architecture example

Just another proof of concept about how build distributed applications.


About the project

This is a quite simple application where we can create a rest API based on an initial CSV file provided by the user.

@rafaell-lycan
rafaell-lycan / dns-prefetch.html
Created January 2, 2017 10:00
DNS prefetch (Google Analytics & Fonts)
<!-- DNS prefetch -->
<link rel='dns-prefetch' href='//ajax.googleapis.com' />
<link rel='dns-prefetch' href='//fonts.googleapis.com' />

Titles

  • Open Sans
  • Montserrat
  • PT Sans

Text

  • Droid Serif
  • PT Serif
@rafaell-lycan
rafaell-lycan / README.md
Last active July 17, 2018 16:39
Web-Combiner: Assets Combiner

Web-Combiner

A CSS, JS, and Handlebars combiner, compressor, and server

The idea

A middleware that knows how to combine, compress and serve CSS and JS files.

When the route is triggered, Web Combiner grab one of the params css and js to create the final result with those files if them exists, otherwise it throws an Error with status 404.

@rafaell-lycan
rafaell-lycan / humanized-greetings.js
Created July 11, 2018 10:04
Get a humanized, "Morning", "Afternoon", "Evening" in Javascript. **Great for user greetings!**
/**
* Function getGreetingTime
* It returns a greet string based on the current time.
* @returns {string}
*
* Usage:
*
* const greetings = `Good ${getGreetingTime()}, James.`
* Assuming the time is 8pm, the output above will be "Good evening, James."
*/

Keybase proof

I hereby claim:

  • I am rafaell-lycan on github.
  • I am rafaell (https://keybase.io/rafaell) on keybase.
  • I have a public key whose fingerprint is 8A78 3B71 E110 8F9B 0301 8853 BA68 E54A 0CE1 28D2

To claim this, I am signing this object: