Skip to content

Instantly share code, notes, and snippets.

Daniel Lo Nigro Daniel15

View GitHub Profile
Daniel15 / XHPServiceProvider.php
Created Jun 1, 2014
Simple autoloader for XHP in Laravel
View XHPServiceProvider.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:
Daniel15 /
Created Oct 25, 2014
Add Google Play Music All Access playlists to the library. Uses
from gmusicapi import Mobileclient
api = Mobileclient()
api.login('', '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:
Daniel15 / gist:3b9fedea012657622fcf
Last active Aug 29, 2015
.bind() in React components
View gist:3b9fedea012657622fcf
// This is bad
var List = React.createClass({
render() {
return (
{ =>
<li key={} onClick={this.props.onItemClick.bind(null,}>
Daniel15 / gist:7f767d0879685a98fc46
Created May 9, 2015
Mono FastCGI package issues
View gist:7f767d0879685a98fc46
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:
View gist:264b258428e797ec6f91
<?xml version="1.0" encoding="utf-16"?>
<?xml-stylesheet type="text/xsl" href="ActivityLog.xsl"?>
<time>2015/08/09 00:50:07.611</time>
<description>Microsoft Visual Studio 2015 version: 14.0.23107.0</description>
Daniel15 / GtkDimScreen.cs
Created Nov 21, 2011
Semi-transparent window in GTK# (Mono, C#)
View GtkDimScreen.cs
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Cairo;
using Gtk;
public class GtkDimScreen
private DrawingArea drawingArea;
Daniel15 / gist:1709107
Created Jan 31, 2012
Get content of currently executing page (ASP / VBScript)
View gist:1709107
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
Daniel15 / dabblet.css
Created Mar 6, 2012
Telstra buttons example
View dabblet.css
border: 0;
padding: 0 0 0 30px;
margin: 0;
background: white url( no-repeat;
height: 25px;
line-height: 25px;
cursor: pointer;
color: #003366;
View gist:2271700
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: =========
======= 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
You can’t perform that action at this time.