Skip to content

Instantly share code, notes, and snippets.

Daniel Lo Nigro Daniel15

Block or report user

Report or block Daniel15

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Daniel15
Daniel15 / XHPServiceProvider.php
Created Jun 1, 2014
Simple autoloader for XHP in Laravel
View XHPServiceProvider.php
<?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
@Daniel15
Daniel15 / PlaylistsToLibrary.py
Created Oct 25, 2014
Add Google Play Music All Access playlists to the library. Uses https://github.com/simon-weber/Unofficial-Google-Music-API
View PlaylistsToLibrary.py
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:
@Daniel15
Daniel15 / gist:3b9fedea012657622fcf
Last active Aug 29, 2015
.bind() in React components
View gist:3b9fedea012657622fcf
// 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>
)}
@Daniel15
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"?>
<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>
@Daniel15
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;
View 1_readme.md
@Daniel15
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
Daniel15 / dabblet.css
Created Mar 6, 2012
Telstra buttons example
View dabblet.css
.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;
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: =========
/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
You can’t perform that action at this time.