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 string_to_slug (str) { | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
var to = "aaaaeeeeiiiioooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) { | |
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
} |
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
## This is a directory/file filter for WinMerge | |
## This filter is a helper for compare 2 laravel proyects in Windows | |
name: Exclude Laravel useless | |
desc: Exclude additional data from Laravel Proyects | |
## This is an inclusive (loose) filter | |
## (it lets through everything not specified) | |
def: include | |
## Filters for filenames begin with f: |
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 {TextInput, View, Keyboard} from 'react-native'; | |
import {Constants, Notifications, Permissions} from 'expo'; | |
export default class Timer extends Component { | |
onSubmit(e) { | |
Keyboard.dismiss(); | |
const localNotification = { | |
title: 'done', |
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
/****************************************************************************** | |
* Implementation of `Nonempty` validator which checks that the provided type | |
* has at least one defined property, excluding `{}`. | |
******************************************************************************/ | |
type Nonempty<T extends { [key: string]: any }> = { [P in keyof T]: T }[keyof T]; | |
declare function wantsNonempty<T extends { [key: string]: any }>(x: Nonempty<T>): true; | |
wantsNonempty({ x: 1 }); | |
wantsNonempty({}); // error expected |