Skip to content

Instantly share code, notes, and snippets.

Modus Create moduscreate

Block or report user

Report or block moduscreate

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:da58d5254d061ebb7fafb5a887a1024a
#!/usr/bin/env node
require('./colorTheme.js');
function stringify(obj) {
return JSON.stringify(obj, undefined, 4);
}
View App.js
import React from 'react';
import {
StyleSheet,
TextInput,
TouchableOpacity,
Text,
KeyboardAvoidingView,
View,
} from 'react-native';
import { Permissions, Notifications } from 'expo';
View sendPushNotification.js
sendPushNotification(token = this.state.token, title = this.state.title, body = this.state.body) {
return fetch('https://exp.host/--/api/v2/push/send', {
body: JSON.stringify({
to: token,
title: title,
body: body,
data: { message: `${title} - ${body}` },
}),
headers: {
'Content-Type': 'application/json',
@moduscreate
moduscreate / registerForPushNotifications.js
Created Feb 16, 2018
Expo Notifications Demo - registerForPushNotifications
View registerForPushNotifications.js
async registerForPushNotifications() {
const { status } = await Permissions.getAsync(Permissions.NOTIFICATIONS);
if (status !== 'granted') {
const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);
if (status !== 'granted') {
return;
}
}
View gist:f3c16a41b448bda1b32ec0f8979c22ce
#ifndef SONG_H
#define SONG_H
#define Song const uint8_t PROGMEM
Song music[] = {
0x14, // Number of tracks
0x00, 0x00, // Address of track 0
0x27, 0x00, // Address of track 1
0x42, 0x00, // Address of track 2
View gist:79a2ec1a7c30e4aa72fb11c920b8a75a
#ifndef SONG2_H
#define SONG2_H
#include "atm_cmd_constants.h"
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
#endif
#ifndef NUM_PATTERNS
View gist:c1375907e744bfbf1fee00dd660c04ac
#ifndef SONG_H
#define SONG_H
#define Song const uint8_t PROGMEM
Song music[] = {
0x14, // Number of tracks
0x00, 0x00, // Address of track 0
0x27, 0x00, // Address of track 1
0x42, 0x00, // Address of track 2
@moduscreate
moduscreate / GameBoard.js
Created Aug 7, 2017
Full file for React Native Shooter, EVADE (prototype).
View GameBoard.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
Dimensions,
PanResponder
} from 'react-native';
View evade_text_generator.js
// JAVASCRIPT To generate this stuff below: (Paste in JSFIddle.net)
var map = {
'A' : 0,
'B' : 1,
'C' : 2,
'D' : 3,
'E' : 4,
'F' : 5,
'G' : 6,
'H' : 7,
@moduscreate
moduscreate / data_dump.js
Last active Oct 21, 2016
GORUCK data dump proposal
View data_dump.js
{
"timestamp": 1476970157974, // Let's use this to determine changes.
// Sourced from http://www.goruck.com/event-landing
"eventLocations" : {
"eventTypes": [
{
"eventTypeId": 1004,
"eventTypeName": "Ascent",
"eventCategoryId": 2,
You can’t perform that action at this time.