Skip to content

Instantly share code, notes, and snippets.

View reyramos's full-sized avatar
💭
I may be slow to respond.

Rey Ramos reyramos

💭
I may be slow to respond.
View GitHub Profile
@reyramos
reyramos / HorizontalPicker.js
Created June 22, 2021 10:29 — forked from jevakallio/HorizontalPicker.js
React Native Horizontal Picker
// @flow
// https://twitter.com/jevakallio/status/941258932529614848
import React, { Component, type Node } from 'react';
import styled from 'styled-components/native';
import Touchable from 'react-native-platform-touchable';
import Carousel from 'react-native-snap-carousel';
// $FlowFixMe
import { LinearGradient } from 'expo';
@reyramos
reyramos / jquery.format.js
Created April 5, 2016 18:40 — forked from mdellavo/jquery.format.js
Format phone number/credit card/ssn/etc inputs by regular expression
(function() {
var formatters = {
'phone' : [/^\(?\s?(\d{3})\s?\)?\s?\-?\s?(\d{3})\s?\-?\s?(\d{4})$/, '($1) $2-$3' ],
'ssn' : [/^(\d{3})\s?\-?\s?(\d{2})\s?\-?\s?(\d{3})$/, '$1-$2-$3' ],
'creditcard' : [/^(\d{4})\s?\-?\s?(\d{4})\s?\-?\s?(\d{4})\s?\-?\s?(\d{4})$/, '$1-$2-$3-$4']
};
jQuery.fn.formatWith = function(regex, replacement) {
$(this).change(function() {
this.value = this.value.replace(regex, replacement);
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);