Skip to content

Instantly share code, notes, and snippets.

View Daniel15's full-sized avatar
💭
Busy

Daniel Lo Nigro Daniel15

💭
Busy
View GitHub Profile
@Daniel15
Daniel15 / gist:d2fdd07df075f5e5353b
Created November 14, 2015 23:11
Babel Flow errors
node_modules/gulp-babel/node_modules/babel-core/lib/api/browser.js:40
40: if (!hold) run(param);
^^^^^^^^^^ function call
40: if (!hold) run(param);
^^^^^ array literal. This type is incompatible with
19: function run(code /*: string*/) /*: any*/ {
^^^^^^ string
node_modules/gulp-babel/node_modules/babel-core/lib/api/browser.js:62
62: run(param, index);
@Daniel15
Daniel15 / gist:bdcfd57b9915bade7d2a
Created November 2, 2015 19:38
Atom instacrash
Process: Atom [19842]
Path: /Applications/Atom.app/Contents/MacOS/Atom
Identifier: com.github.atom
Version: 1.1.0 (1.1.0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Atom [19842]
User ID: 215897963
Date/Time: 2015-11-02 11:32:50.249 -0800
<?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 / BaseStore.js
Created May 10, 2015 07:40
Simple Flux
import EventEmitter from 'events';
import Dispatcher from '../dispatcher';
const CHANGE_EVENT = 'change';
export default class BaseStore extends EventEmitter {
constructor() {
super();
this.dispatchToken = Dispatcher.register(this.handleDispatch.bind(this));
@Daniel15
Daniel15 / gist:7f767d0879685a98fc46
Created May 9, 2015 05:27
Mono FastCGI package issues
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:
@Daniel15
Daniel15 / gist:3b9fedea012657622fcf
Last active August 29, 2015 14:20
.bind() in React components
// 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 / PlaylistsToLibrary.py
Created October 25, 2014 05:50
Add Google Play Music All Access playlists to the library. Uses https://github.com/simon-weber/Unofficial-Google-Music-API
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 / XHPServiceProvider.php
Created June 1, 2014 06:21
Simple autoloader for XHP in Laravel
<?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 / gist:397b1a0374a4bc78c84d
Created June 1, 2014 06:14
List of "feelings" on Facebook
accomplished
aggravated
alive
alone
amazed
amazing
amused
angry
annoyed
anxious
@Daniel15
Daniel15 / gist:081cc25b0ce166646528
Created May 31, 2014 05:02
composer.json example for XHP in Laravel
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.1.*",
"facebook/xhp": "dev-master"
},
"autoload": {