Skip to content

Instantly share code, notes, and snippets.

View alur222's full-sized avatar
🎯
Focusing

Raul Torrefiel Jr. alur222

🎯
Focusing
  • Cebu, Philippines
View GitHub Profile
const handlers = {
number: value => <NumberDisplay>{value}</NumberDisplay>
currency: value => <CurrencyDisplay customProps value={value} />
time: value => <TimeDisplay time={value} customProps />
date: value => <DateDisplay date={value} showTime={false} />
default: value => value,
};
const displayData = (type, value) => {
const handler = handlers[type] || handlers.default;
@stubailo
stubailo / graphql-subscriptions.js
Last active October 12, 2020 22:40
A very basic demo of GraphQL subscriptions with the graphql-subscriptions package
// npm install graphql graphql-tools graphql-subscriptions
const { PubSub, SubscriptionManager } = require('graphql-subscriptions');
const { makeExecutableSchema } = require('graphql-tools');
// Our "database"
const messages = [];
// Minimal schema
const typeDefs = `
type Query {
@rclai
rclai / meteor-wrapAsync.js
Last active January 30, 2023 15:20
Flexible example of Meteor.wrapAsync
// Thanks @trusktr
var requestSync = Meteor.wrapAsync(function(url, callback) {
request(url, function(error, response, body) {
callback(error, {response: response, body: body})
})
});
var result = requestSync("http://google.com");
console.log(result.response, result.body);
@umpirsky
umpirsky / A.markdown
Last active August 3, 2023 18:14 — forked from olivierlacan/An_example.markdown
Sublime Text Monokai Sidebar Theme.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: