Skip to content

Instantly share code, notes, and snippets.

View davidroman0O's full-sized avatar
👨‍🍳
Let me cook

0xAkraw davidroman0O

👨‍🍳
Let me cook
View GitHub Profile
/**
* @providesModule PatientList
*/
import NavigationBar from 'react-native-navbar';
import NavigationButtons from 'NavigationButtons';
import React, { ListView, Navigator, StyleSheet, Text, TextInput, TouchableHighlight, View } from 'react-native';
import { connect } from 'react-redux/native'
@connect(state => ({
patients: state.patients
@Willmo36
Willmo36 / countdown.most.js
Created October 15, 2015 14:55
count down with most.js
import most from 'most';
const load$ = most.fromEvent('DOMContentLoaded', document);
const tick$ = load$.flatMap(() => {
return most.iterate((f) => f + 1, 0).take(5).flatMap(v => most.of(v).delay(v * 1000));
});
load$.observe(() => console.log('timer start'));
tick$.observe(x => console.log('timer tick', x));
@lenaten
lenaten / gist:96f7102c92b3a7d59a50
Last active December 6, 2017 10:59
Hosting React app in s3 with CloudFront
- create s3 bucket, for example: react.
- create cloudfront distributions with these settings:
- Default Root Object: index.html
- Origin Domain Name: s3 bucket url, for example: react.s3.amazonaws.com
- add custom error page with these settings:
- HTTP Error Code: 403: Forbidden
- Customize Error Response: Yes
- Response Page Path: /index.html
- HTTP Response Code: 200: OK
@briancavalier
briancavalier / most-sample-promises.md
Last active November 19, 2019 16:47
Description of most.js sample+promises issue

This is an explanation of the extremely subtle problem in this most.js issue. This solution described isn't necessarily the best, or most rigorous solution. We're investigating other potential solutions, but wanted to record this information in case it's interesting to someone.

Background

One of the fastest ways to schedule a task in ES6 is to use a promise. They tend to use the fastest micro-tick scheduling option the platform provides. So, when a task is scheduled with scheduler.asap it doesn’t use setTimeout 0, it uses a promise to schedule itself, because that’s basically as close to zero-time as you can get in a platform independent way

given this:

@jarretmoses
jarretmoses / React Native Clear Cache
Last active April 23, 2025 11:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@TooTallNate
TooTallNate / updater.sh
Last active May 23, 2019 00:02
Google Domains Dynamic DNS record update script - syncs a host to a target (pseudo-ALIAS)
#!/usr/bin/env sh
#
# Usage:
# USERNAME=abcd12345 PASSWORD=ghij67890 HOST=n8.io TARGET=alias.zeit.co ./updater.sh
URL="https://domains.google.com/nic/update"
HOST_IP=$(dig @8.8.8.8 +short A "$HOST" | sort | tail -1)
TARGET_IP=$(dig @8.8.8.8 +short A "$TARGET" | sort | tail -1)
@jatins
jatins / phineas-intro.md
Last active July 16, 2024 05:10
Building realtime application with DynamoDB (and potentially any database with an operation log)

This was built and written in 2016. While the project didn't gain much traction, the intro post is kept here for posterity.


Building realtime applications is hard.

A scalable solution to this problem involves many cumbersome steps:

  • Hooking into replication logs of the database servers, or writing custom data invalidating logic for realtime UI components.
  • Adding messaging infrastructure (e.g. RabbitMQ) to your project.
  • Writing sophisticated routing logic to avoid broadcasting every message to every web server.
  • Reimplementing database functionality in the backend if your app requires realtime computation (e.g. realtime leaderboards).
componentWillReceiveProps(nextProps) {
if (nextProps.lastRequestedUserLocationAt > this.props.lastRequestedUserLocationAt) {
this.centerMapToUser(nextProps.currentLocation);
}
if (nextProps.lastUpdated > this.props.lastUpdated) {
const markers = this.createMarkersForLocations(nextProps);
if (markers && Object.keys(markers)) {
const clusters = {};
@ahmdrz
ahmdrz / dump.go
Created September 23, 2016 08:07
Golang Reflection Example of an array.
package main
import (
"fmt"
"reflect"
)
type Test struct {
Name string
}
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active June 23, 2025 01:06
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites