Firstly install Brew on your MAC
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then install PHP
- brew update
- brew tap homebrew/dupes
- brew tap homebrew/php
- brew install php56
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |
SOURCE: http://htmlpurifier.org/live/smoketests/xssAttacks.php |
.rounded-corners-gradient-borders { | |
width: 300px; | |
height: 80px; | |
border: double 4px transparent; | |
border-radius: 80px; | |
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff); | |
background-origin: border-box; | |
background-clip: padding-box, border-box; | |
} |
Firstly install Brew on your MAC
Then install PHP
# Get-EvengLog doesn't quite work I guess: | |
# https://stackoverflow.com/questions/31396903/get-eventlog-valid-message-missing-for-some-event-log-sources# | |
# Get-EventLog Application -EntryType Error -Source "DistributedCOM" | |
# The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID | |
#$logs = Get-EventLog -LogName "System" -EntryType Error -Source "DCOM" -Newest 1 -Message "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID*" | |
# 2 is error | |
# 3 is warning | |
$EVT_MSG = "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID" | |
# Search for System event log ERROR entries starting with the specified EVT_MSG | |
$logEntry = Get-WinEvent -FilterHashTable @{LogName='System'; Level=2} | Where-Object { $_.Message -like "$EVT_MSG*" } | Select-Object -First 1 |
# In a directory full of SVG files, extract and display values of their viewBox | |
# 1/2 Rough display | |
grep -H -o -i --color -E 'viewbox="([0-9. ]+)?"' *.svg | |
# Output: | |
# uEA01-arrow-down.svg:viewBox="0 0 50 50" | |
# uEA02-arrow-left.svg:viewBox="0 0 50 50" | |
# 2/2 Better display (no more color highlighting with Git Bash on Win 10 though) |
const Button = styled.button` | |
border: 1px solid black; | |
${props => props.primary && primaryStyle}; | |
${props => props.danger && dangerStyle}; | |
${props => props.warning && warningStyle}; | |
` | |
const primaryStyle = css` | |
color: white; | |
background: blue; |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Example", | |
"type": "node", | |
"request": "launch", | |
"runtimeExecutable": "node", | |
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], |
#!/bin/sh -x | |
set -e | |
SIZES=" | |
16,16x16 | |
32,16x16@2x | |
32,32x32 | |
64,32x32@2x | |
128,128x128 |