Skip to content

Instantly share code, notes, and snippets.

View wgrafael's full-sized avatar
:octocat:

Rafael Dantas wgrafael

:octocat:
  • PagSeguro
  • São Paulo, SP
View GitHub Profile
@wgrafael
wgrafael / install.sh
Last active July 10, 2017 20:54
Stop song and lock the screen [Linux]
sudo vim /usr/bin/music-control
# put mpris2-remote.py content
chmod +x /usr/bin/music-control
sudo vim /usr/bin/pause-on-lock-screen
# put lock-screen.sh content
chmod +x /usr/bin/lock-screen
@wgrafael
wgrafael / loading-state.service.ts
Last active November 17, 2016 01:18
Loading State Service with dispenser in Angular2
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
interface State {
isLoading: boolean;
blockerLoading: boolean;
}
/**
* Responsible by loadingState
@wgrafael
wgrafael / functions.php
Last active July 6, 2023 18:04
Convert array with key in dot notation for multidimensional array
<?php
/**
* Convert array with key in dot notation for multidimensional array
*
* Example:
* Input: [ "name.firstname" => "Rafael", "name.lastname" => "Dantas", "a.b.c" => "d" ]
* Output: [ "name" => [ "firstname" => "Rafael", "lastname" => "Dantas" ], "a" => [ "b" => [ "c" => "d" ] ]
*
* @param $array Array with key in dot notation