Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
function visit_nodes_iterative(node) { | |
node = node || document; | |
do | |
{ | |
/* Do something with node here */ | |
node = node.firstChild || node.nextSibling || function() { | |
while ((node = node.parentNode) && !node.nextSibling); | |
return node ? node.nextSibling : null; |
server { | |
listen 80; | |
server_name symfony2; | |
root /var/www/symfony2/web; | |
error_log /var/log/nginx/symfony2.error.log; | |
access_log /var/log/nginx/symfony2.access.log; | |
# strip app.php/ prefix if it is present |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
The list would not be updated for now. Don't write comments.
The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.
Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:
githubUsers
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
<?php | |
/** | |
* Использование: | |
* $v = new VideoThumb($link); | |
* $v->getVideo(); //Ссылка на видео | |
* $v->getTitle(); //Название ролика | |
* $v->fetchImage($path) //Скачать самое большое превью ролика | |
* | |
* Прогнать тест: |
# 1.install gource using HomeBrew | |
$ brew install gource | |
# 2.install avconv | |
git clone git://git.libav.org/libav.git | |
cd libav | |
# it will take 3-5 minutes to complie, be patient. | |
./configure --disable-yasm | |
make && make install |
>> | |
>+[[-]+>>>+>++>- >++> ->+>+>+>>+++>+++ ++[<<< < | |
<<<<++ ++++> >+ ++>>>>++>++++++>-] >>+<<, [>> | |
-<<[> +<-]] >[<+>- ]>[<< <[<]<< ->> | |
>[>] >>-]< +++++ ++++[ <<[ | |
>-<- ]>>>+ <<[> >-<<[<+>- ]]<[>+<-]>>> [-<<< <[< ]>[<+>-] >[>]> >>]< <<<[ <]<+>>[>]>[<+>- ]>[<+ >-]<- ]<[ | |
-]+< <[-]> [>-<<<[-]>>[-]]>[ [-]<[ -]<< [> |
<?php | |
$foo = new Foo(); | |
$foo->id = 1; | |
$foo->text = 'Hello'; | |
echo $foo->id; // 1 | |
echo $foo->text; // Hello World! |