Skip to content

Instantly share code, notes, and snippets.

View GiacomoP's full-sized avatar
🏠
Working from home

Giacomo Persichini GiacomoP

🏠
Working from home
View GitHub Profile
@GiacomoP
GiacomoP / schema.graphql
Last active September 2, 2019 12:33
M5S Rousseau - Public GraphQL Schema
# source: https://api.rousseau.movimento5stelle.it/graphql
# timestamp: Thu Aug 29 2019 13:23:08 GMT+0100 (Irish Standard Time)
enum AcceptanceStatus {
PENDING
APPROVED
REJECTED
}
type Badge implements Node {
@GiacomoP
GiacomoP / app.js
Last active September 2, 2019 12:33
M5S Rousseau - Admin Frontend app
(function(e) {
function t(t) {
for (var n, s, r = t[0], l = t[1], d = t[2], c = 0, m = []; c < r.length; c++) s = r[c], a[s] && m.push(a[s][0]), a[s] = 0;
for (n in l) Object.prototype.hasOwnProperty.call(l, n) && (e[n] = l[n]);
u && u(t);
while (m.length) m.shift()();
return o.push.apply(o, d || []), i()
}
function i() {
@GiacomoP
GiacomoP / config.php
Created August 22, 2016 18:07
Example of a config file
<?php
return array(
'projectName' => 'Other',
'author' => 'Itsame'
);
@GiacomoP
GiacomoP / config.default.php
Created August 22, 2016 18:06
Example of a default config file
<?php
return array(
'projectName' => 'Survey',
'author' => 'Nobody',
'baseUrl' => 'http://survey.local',
'mode' => 'development',
'cache' => true,
'mysql' => array(
'host' => 'localhost',
@GiacomoP
GiacomoP / Config.php
Created August 22, 2016 18:05
Example of a Config class
<?php
namespace Survey;
/**
* Helper to get configuration values.
*/
class Config
{
/**
@GiacomoP
GiacomoP / csvToAssociativeArray.php
Created May 26, 2016 13:27
Handy code to have a CSV file as an associative array
<?php
$rows = array_map('str_getcsv', file('filename.csv'));
array_walk($rows, function(&$a) use ($rows) {
$a = array_combine($rows[0], $a);
});
array_shift($rows);