Skip to content

Instantly share code, notes, and snippets.

View samvaughton's full-sized avatar

Sam samvaughton

  • Situ
  • Devon
  • 13:00 (UTC +01:00)
View GitHub Profile
@dougal83
dougal83 / equal-value-validator.ts
Created November 24, 2016 19:05
Angular 2 validator to compare two controls in a form (e.g. passwords on signup forms) v0.1
/** '/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];
@alirobe
alirobe / reclaimWindows10.ps1
Last active May 27, 2024 21:14
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### 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
###
###
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

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 :

@Kalyse
Kalyse / All Amenities.txt
Created February 6, 2014 13:35
Rentivo Amenities
'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
@Kalyse
Kalyse / Spotify Remote
Created February 6, 2014 11:06
Spotify Remote
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri string:http://open.spotify.com/track/6JEK0CvvjDjjMUBFoXShNZ
@Kalyse
Kalyse / Spotify Introspection DBus
Created February 4, 2014 21:20
Spotify Introspection DBUS
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"/>