This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text.RegularExpressions; | |
using System.Xml; | |
using System.Xml.Linq; | |
namespace Formix.Utils | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git command autocompletion script | |
source ~/bin/git-completion.bash | |
# git commamands simplified | |
alias gst='git status' | |
alias gco='git checkout' | |
alias gci='git commit' | |
alias grb='git rebase' | |
alias gbr='git branch' | |
alias gad='git add -A' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use this hook to manipulate incoming or outgoing data. | |
// For more information on hooks see: http://docs.feathersjs.com/hooks/readme.html | |
import fromPairs from 'lodash/fromPairs' | |
import map from 'lodash/map' | |
/** | |
* upsert | |
* Executes upsert on a Mongoose model | |
* Configure in your service as a before:create hook | |
* Note: Update hooks will not fire as a result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
module.exports = function (root) { | |
return function (req, res) { | |
const aasa = path.join(root, 'apple-app-site-association') | |
res.set('Content-Type', 'application/pkcs7-mime') | |
res.status(200) | |
res.sendFile(aasa) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PushNotifications = new require('node-pushnotifications') | |
const bundleId = '<BUNDLE_ID>' | |
const deviceToken = '<DEVICE_TOKEN>' | |
const settings = { | |
apn: { | |
token: { | |
"key": './certs/key.p8', // optionally: fs.readFileSync('./certs/key.p8') | |
"keyId": "<APNS_AUTH_KEY>", | |
"teamId": "<TEAM_ID>", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from 'lodash' | |
const json = { | |
results: [] //...use actual results from API | |
} | |
const result = _.chain(json.results[0].address_components) | |
.keyBy('types[0]') | |
.mapValues('short_name') | |
.value() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import { StyleSheet, Alert, Text, View, PermissionsAndroid } from 'react-native' | |
function currentPosition() { | |
return new Promise((resolve, reject) => | |
navigator.geolocation.getCurrentPosition( | |
({ coords }) => resolve(coords), | |
(err) => reject(err), { | |
enableHighAccuracy: false, | |
timeout: 1000, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myCoolFunc = () => { | |
const name = new Error().stack.match(/at (.*?) /)[1] | |
console.log(name) // myCoolFunc | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function(root, factory) { | |
root.pubsub = factory(root); | |
}(this, function() { | |
var publishEmitter; | |
var directory; | |
var eventStream; | |
var SubscriptionDefinition = function(stream, callback) { | |
this.stream = stream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From https://github.com/kirankalyan5/react-native-segmented-control-tab | |
// Added enabled prop | |
// Use Material theme Indigo color defaults | |
// Add propType validation | |
// Lower opacity for disabled | |
// Fix border and width issues for Android | |
import React from "react" | |
import { | |
View, | |
ViewPropTypes, |
OlderNewer