3 years ago
Emoji as Favicon
<link rel="icon" href="data:image/svg+xml,<svg xmlns="http://w3.org/2000/svg" viewBox="0 0 100 100">
<text y=".9em" font-size="90">💩</text>
</svg>" />
4 years ago
FFMPEG things
image + audio to video
ffmpeg -loop 1 -i image.jpg -i audio.wav -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest out.mp4
4 years ago
Help Solve the File Format Problem
The File Format Problem in this context is that over the last century, many types of electronic information have been presented in formats that are non-intuitive and subject to the rapidly-shifting interests of what is newest and best. As a result, thousands of programs, documents, images and binary files are in danger of being unreadable to later generations as no readily available information about accessing them is to be found. Various projects have been launched in the last 20 years to deal with this problem, but they all lack a groundswell of directed volunteers working to once and for all get all the disparate information into one place and easily referenced by all. This is the goal of this project.
5 years ago
"'padding: 50% 0;' will force it to be a square"
what? why?
some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider
<style>.sqtest
{
background:#f00;
padding: 50% 0;
}
</style>
<div class=sqtest> </div>
some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider some text to make this wider
5 years ago
JavaScript + CSS
element.style.getPropertyValue("color");
getComputedStyle(element).getPropertyValue("color");
element.style.setProperty("color", "#f00");
5 years ago
HTML HEAD links
stylesheet | external stylesheet |
---|---|
alternate | other versions of the page (different languages or media formats) |
alternate stylesheet | attributes can be combined |
start | the first document in a series of documents, of which the current page is a member |
next | the next document in a series |
prev | the previous document in a series |
contents | table of contents |
toc | table of contents (less supported) |
index | index for the current page |
glossary | glossary of terms related to the current page |
copyright | copyright statement for the current page |
chapter | |
section | |
subsection | |
appendix | |
help | help about the current document |
bookmark | bookmark or key entry point within an extended document |
(I haven't updated this in ages)
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
https://htmlhead.dev/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
https://htmlhead.dev/
5 years ago
HTTP status codes
Successful Client Requests
200 OK
201 Created
202 Accepted
203 Non-Authorative Information
204 No Content
205 Reset Content
206 Partial Content
Client Request Redirected
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
303 See Other
304 Not Modified
305 Use Proxy
307 Temporary Redirect
Client Request Errors
400 Bad Request
401 Authorization Required
402 Payment Required (not used yet)
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable (encoding)
407 Proxy Authentication Required
408 Request Timed Out
409 Conflicting Request
410 Gone
411 Content Length Required
412 Precondition Failed
413 Request Entity Too Long
414 Request URI Too Long
415 Unsupported Media Type
416 Requested range not satisfiable
417 Expectation failed
Server Errors
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported
200 OK
201 Created
202 Accepted
203 Non-Authorative Information
204 No Content
205 Reset Content
206 Partial Content
Client Request Redirected
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
303 See Other
304 Not Modified
305 Use Proxy
307 Temporary Redirect
Client Request Errors
400 Bad Request
401 Authorization Required
402 Payment Required (not used yet)
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable (encoding)
407 Proxy Authentication Required
408 Request Timed Out
409 Conflicting Request
410 Gone
411 Content Length Required
412 Precondition Failed
413 Request Entity Too Long
414 Request URI Too Long
415 Unsupported Media Type
416 Requested range not satisfiable
417 Expectation failed
Server Errors
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported
(haven't updated this in ages)
6 years ago
upgrade OpenSUSE from Leap to Tumbleweed
su
mkdir /etc/zypp/repos.d/old
mv /etc/zypp/repos.d/*.repo /etc/zypp/repos.d/old
zypper ar -f -c http://download.opensuse.org/tumbleweed/repo/oss repo-oss
zypper ar -f -c http://download.opensuse.org/tumbleweed/repo/non-oss repo-non-oss
zypper ar -f -c http://download.opensuse.org/tumbleweed/repo/debug repo-debug
zypper ar -f -c http://download.opensuse.org/update/tumbleweed/ repo-update
zypper dup
9 years ago
Simple blendmode equations
multiply | a * b |
screen | 1 - (1 - a) * (1 - b) |
darken | min(a, b) |
lighten | max(a, b) |
difference | abs(a - b) |
negation | 1 - abs(1 - a - b) |
exclusion | a + b - 2 * a * b |
overlay | a < .5 ? (2 * a * b) : (1 - 2 * (1 - a) * (1 - b)) |
hard light | b < .5 ? (2 * a * b) : (1 - 2 * (1 - a) * (1 - b)) |
soft light | b < .5 ? (2 * a * b + a * a * (1 - 2 * b)) : (sqrt(a) * (2 * b - 1) + (2 * a) * (1 - b)) |
dodge | a / (1 - b) |
burn | 1 - (1 - a) / b |
http://www.blackpawn.com/blog/coding/2006/08/19/photoshop-blend-modes/
and http://www.pegtop.net/delphi/articles/blendmodes/