These are some benchmarks for various methods of using MySQL in PHP. They are used in this forum topic on webDevRefinery
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 | |
/** | |
* Simple autoloader for XHP in Laravel, when you don't want to use Composer's | |
* autoloader. To use: | |
* 1. Place this file somewhere in an autoloader-enabled directory of your | |
* Laravel installation (app/controllers is fine). | |
* 2. Modify `app/config/app.php` and add 'XHP\XHPServiceProvider' to the | |
* "Autoloaded Service Providers" section. | |
* | |
* More info on XHP in Laravel: http://dan.cx/2014/05/xhp-laravel |
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
from gmusicapi import Mobileclient | |
api = Mobileclient() | |
api.login('daniel@example.com', 'hunter2') | |
playlist_contents = api.get_all_user_playlist_contents() | |
for playlist in playlist_contents: | |
playlist_tracks = playlist.get('tracks') | |
for pl_track in playlist_tracks: |
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
// This is bad | |
var List = React.createClass({ | |
render() { | |
return ( | |
<ul> | |
{this.props.items.map(item => | |
<li key={item.id} onClick={this.props.onItemClick.bind(null, item.id)}> | |
... | |
</li> | |
)} |
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
22:25 daniel@dan /home/daniel | |
% sudo apt-get install mono-fastcgi-server mono-fastcgi-server4 | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
Some packages could not be installed. This may mean that you have | |
requested an impossible situation or if you are using the unstable | |
distribution that some required packages have not yet been created | |
or been moved out of Incoming. | |
The following information may help to resolve the situation: |
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
<?xml version="1.0" encoding="utf-16"?> | |
<?xml-stylesheet type="text/xsl" href="ActivityLog.xsl"?> | |
<activity> | |
<entry> | |
<record>1</record> | |
<time>2015/08/09 00:50:07.611</time> | |
<type>Information</type> | |
<source>VisualStudio</source> | |
<description>Microsoft Visual Studio 2015 version: 14.0.23107.0</description> | |
</entry> |
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
using System; | |
using System.Reflection; | |
using System.Runtime.InteropServices; | |
using Cairo; | |
using Gtk; | |
public class GtkDimScreen | |
{ | |
private DrawingArea drawingArea; | |
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
Dim sPath | |
Dim oFS | |
Dim oTextStream | |
Dim sFile | |
sPath = Server.MapPath(Request.ServerVariables("SCRIPT_NAME")) | |
Set oFS = CreateObject("Scripting.FileSystemObject") | |
Set oTextStream = oFS.OpenTextFile(sPath, 1) | |
sFile = oTextStream.ReadAll() | |
Set oFS = Nothing |
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
.telstra | |
{ | |
border: 0; | |
padding: 0 0 0 30px; | |
margin: 0; | |
background: white url(http://i.imgur.com/N14wq.png) no-repeat; | |
height: 25px; | |
line-height: 25px; | |
cursor: pointer; | |
color: #003366; |
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
root@lisa:/# /etc/init.d/php5-fpm restart | |
Restarting PHP5 FastCGI Process Manager: php5-fpm*** glibc detected *** /usr/sbin/php5-fpm: free(): invalid pointer: 0xb6d860f0 *** | |
======= Backtrace: ========= | |
/lib/i386-linux-gnu/libc.so.6(+0x6e1da)[0xb6f621da] | |
/lib/i386-linux-gnu/libc.so.6(+0x6fa38)[0xb6f63a38] | |
/lib/i386-linux-gnu/libc.so.6(cfree+0x6d)[0xb6f66b3d] | |
/usr/sbin/php5-fpm(destroy_zend_class+0x228)[0x83192a8] | |
======= Memory map: ======== | |
08048000-08710000 r-xp 00000000 08:01 11403530 /usr/sbin/php5-fpm | |
08710000-08771000 r-xp 006c7000 08:01 11403530 /usr/sbin/php5-fpm |