Skip to content

Instantly share code, notes, and snippets.

@thiamsantos
thiamsantos / rxjs-patching.js
Created December 13, 2016 21:25 — forked from ericelliott/rxjs-patching.js
Reduce bundle size with RxJS patching
import { Observable } from 'rxjs/Observable';
// then patch import only needed operators:
import 'rxjs/add/operator/map';
import 'rxjs/add/observable/from';
const foo = Observable.from([1, 2, 3]);
foo.map(x => x * 2).subscribe(n => console.log(n));
@thiamsantos
thiamsantos / index.html
Created January 27, 2017 16:28
Shortway usage example.
<!DOCTYPE html>
<html>
<head>
<style>
#app {
padding-left: 20px;
}
#quote {
box-sizing: border-box;
border-left: 5px solid #e0e0e0;
@thiamsantos
thiamsantos / links.js
Created February 21, 2017 00:14
Social Media Sharing URLS
@thiamsantos
thiamsantos / CONTRIBUTING.md
Created March 12, 2017 00:52
Example of a contributing file

Contributing to project-name

First off, thanks for taking the time to contribute!

Now, take a moment to be sure your contributions make sense to everyone else. These are just guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

Reporting Issues

Found a problem? Want a new feature? First of all see if your issue or idea has already been reported. If don't, just open a new clear and descriptive issue.

@thiamsantos
thiamsantos / emoji-commit.md
Last active March 15, 2017 18:03
Commit Message Emoji

Commit Message Emoji

Every commit is important. So let's celebrate each and every commit with a corresponding emoji! 😄

Which Emoji to Use? 😕

Commit Type Emoji
Initial Commit 🎉 :tada:
@thiamsantos
thiamsantos / init.coffee
Last active April 3, 2017 00:58
Atom settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@thiamsantos
thiamsantos / todos.sql
Created April 4, 2017 00:36
TODOS sql
CREATE TABLE users (
id BIGINT(8) AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(16) NOT NULL,
email VARCHAR(255) NOT NULL,
password VARCHAR(32) NOT NULL
);
CREATE TABLE todos (
id BIGINT(8) AUTO_INCREMENT PRIMARY KEY,
completed TINYINT(1) NOT NULL DEFAULT 0,
@thiamsantos
thiamsantos / font.css
Created May 16, 2017 21:40
System fonts css
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
@thiamsantos
thiamsantos / will-appear.js
Created July 19, 2017 21:27
Check if a element will appear in the screen
const throttle = (limit, fn) => {
let wait = false
return (...args) => {
if (!wait) {
fn(...args)
wait = true
setTimeout(() => {
wait = false
}, limit)
@thiamsantos
thiamsantos / support-input-date.js
Created July 25, 2017 20:27
check if browser support input type date
function supportInputDate() {
const type = 'date'
const smile = '1)'
const inputElement = document.createElement('input')
inputElement.setAttribute('type', type)
inputElement.value = smile
inputElement.value !== smile
return inputElement.type === 'date' && inputElement.value !== smile