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
Verifying that +mikealmond is my blockchain ID. https://onename.com/mikealmond |
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 | |
function mb_str_shorten($content, $maxCharacters, $showDots = "…", $stopAtSpace = true, $encoding = 'UTF-8') | |
{ | |
if(mb_strlen($content, $encoding) > $maxCharacters) { | |
if(!$stopAtSpace) { | |
return mb_substr($content, 0, $maxCharacters, $encoding) . $showDots; | |
} else { | |
$toReturn = mb_substr($content, 0, $maxCharacters, $encoding); |
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
find . -type d -exec chmod u=rwx,g=rx,o=rx {} \; | |
find . -type f -exec chmod u=rw,g=r,o=r {} \; |
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
alias please="sudo" |
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
var data = { | |
'id': 1, | |
'body': $('#body').val() | |
}; | |
if (hasTitle == true) { | |
data['title'] = $('#title').val(); | |
} | |
$.post('/ajax/update-something', data, function (response) { | |
$('#template').html(response); | |
}); |
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 | |
$x = 'foo'; | |
$y = 'bar'; | |
$x ^= $y ^= $x ^= $y; | |
print $x; //bar | |
print $y; //foo |
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
<input type="file" multiple name="photos[]"> | |
<?php | |
$total = count($_FILES['photos']['name']) - 1; | |
for ($i = 0; $i <= $total; $i++) { | |
uploadFile($_FILES['photos']['tmp_name'][$i]); | |
} | |