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
/** '/src/app/shared/equal-value-validator.ts' */ | |
/** Just a demo/draft, please ensure your implementation is sound before going live */ | |
import { FormGroup, ValidatorFn } from '@angular/forms'; | |
/** this control value must be equal to given control's value */ | |
export function equalValueValidator(targetKey: string, toMatchKey: string): ValidatorFn { | |
return (group: FormGroup): {[key: string]: any} => { | |
const target = group.controls[targetKey]; | |
const toMatch = group.controls[toMatchKey]; |
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
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle
The API we are creating in this gist will follow these rules :
- The API only returns JSON responses
- All API routes require authentication
- Authentication is handled via OAuth2 with
password
Grant Type only (no need for Authorization pages and such). - API versioning is managed via a subdomain (e.g.
v1.api.example.com
)
The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :
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
'Casino', 'Theme Park', 'Funicular Railway', 'Library', 'Public Villas & Gardens', 'National Park', 'National Heritage', 'Religious', 'Museum', 'Historical Monuments', 'Historical Ruins', 'Church', 'Golf', 'Bicycling', 'Bike Rentals', 'Boat Rentals/Charters', 'Canoeing/Kayaking', 'Fishing', 'Gym', 'Hiking/Trails', 'Horseback Riding', 'Float Plane/Helicopter', 'Rowing Boats', 'Sailing', 'Tennis Court', 'Table Tennis', 'Squash', 'Ice Skating', 'Local Park/Green Space', 'Skidoo/Snow Mobile', 'Water Theme Park', 'Spa Wellness Centre', 'Wind Surfing', 'Skiing - Snow', 'Snow Boarding', 'Skiing - Water', 'Ice Rink', 'Scuba Diving', 'Internet - Wi-Fi', 'Internet - Dial-up', 'Internet - Cabled', 'Internet - Dongle', 'Internet - Highspeed', 'Telephone', 'Fax Machine', 'Computer Available', 'Standard Definition TV', 'High Definition TV', 'Satellite TV', 'Digital TV', 'VCR Player', 'iPod Docking Station', 'DVD Player', 'Games Console', 'Video Game Library', 'Cable TV', 'Movie/Video Library', 'Music Library', 'Stereo Syst |
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
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri string:http://open.spotify.com/track/6JEK0CvvjDjjMUBFoXShNZ |
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
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Introspectable.Introspect | |
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | |
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | |
<node> | |
<interface name="org.mpris.MediaPlayer2"> | |
<method name="Raise"/> | |
<method name="Quit"/> | |
<property access="read" type="b" name="CanQuit"/> |