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
1. Censorship resistant resource access. | |
Govts turn off the internet. (Egypt 2014). Use of peer to peer resource access allows N geographically proximate users accesss to the same file or resources, assuming at least one peer has downloaded them already, for everyone else to get it through them. | |
2. Broken Links. | |
The original tenets of the web are violated daily: Links to corporate-supplied services and resources are taken down when censored or when that service goes down or when that corporate goes out of business, or when a hitherto free resource is hidden behind a paywall. Burning books anyone? | |
3. Verifiability. |
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
#!/bin/bash | |
# | |
# Russell Michell 2018 <russellmichell@catalyst.net.nz> | |
# | |
# What is this? | |
# | |
# Provides an indication of any security vulnerabilities in a project's composer and npm dependencies | |
errors_npm=0 | |
errors_cmp=0 |
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
#!/bin/bash | |
# Assumes Apache httpd | |
# Russell Michell 2018 <russellmichell+usevagrant@catalyst.net.nz> | |
from=$1 | |
to=$2 | |
update-alternatives --set php /usr/bin/php$to && a2dismod php$from && a2enmod php$to && service apache2 restart |
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
<?php | |
use SilverStripe\Forms\TextField; | |
use SilverStripe\View\Requirements; | |
class YouTubeField extends TextField { | |
/** | |
* @var string | |
* @config |
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
<?php | |
$wanted = array(2, 4, 6); | |
$not_wanted = array(3, 5); | |
$candidates_w = $candiates_nw = []; | |
for ($i=0; $i < 100; $i++) | |
{ | |
foreach ($wanted as $w_permid) { | |
if ($w_permid & $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
A SilverStripe locale module base don the categories stipulated in GNU's "Locale Categories" ala: https://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/Locale-Categories.html |
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
Talks to see: | |
* http://scaleconf.co.nz/talks/BethanyMacri.html (8/10) | |
* http://scaleconf.co.nz/talks/PaulStack.html (7/10) | |
* http://scaleconf.co.nz/talks/JonahKowall.html (8/10) | |
* http://scaleconf.co.nz/talks/JohnClegg.html (8/10) | |
* http://scaleconf.co.nz/talks/DustinWhittle.html (7/10) | |
* http://scaleconf.co.nz/talks/TravisBischel.html (5/10) | |
* http://scaleconf.co.nz/talks/KaraHatherly.html (8/10) | |
* http://scaleconf.co.nz/talks/AlvaroVidela.html (5/10) |
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
PSR-2 says... | |
* Indentation: 4 spaces | |
* Newline: UNIX LF | |
* End of line: No whitespace | |
* End of file: Single newline (Why? Historical tooling reasons) |
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
Debugging: | |
"Never, ever assume you think you know where a bug comes from". I have seen developers arbitrarly put in break points and debug statements | |
and then work there way forwards to the point at which the error manifests. Don't do this, precisely becuase your break point or debug statement *is* arbitrary*. | |
Becuase the framework or library you're using may have poorly understood or poorly documented, unpredicatable | |
or plain broken behaviour, then place your breakpoints or add your logging there first and only then work your way forwards. | |
UX: | |
"Always assume your user is deaf, dumb, blind and stupid." No offence meant *whatsoever*. If you can get your project to be used by someone of this ilk, you've already won. |
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
PHP's "statics" | |
1. Static methods within a class. | |
Note: Allows dev's to encapsulate similar methods within a class, but with the "benefit" of easy access by means of global scope. | |
Reference: http://php.net/manual/en/language.oop5.static.php | |
Example: | |
class Foo | |
{ |