Skip to content

Instantly share code, notes, and snippets.

View LeonanCarvalho's full-sized avatar

Leonan Carvalho LeonanCarvalho

View GitHub Profile
@LeonanCarvalho
LeonanCarvalho / ckan.service
Created February 21, 2018 14:17
systemd ckan service
[Unit]
Description=CKAN Service
Requires=solr.service postgresql.service
After=solr.service postgresql.service
[Service]
User=ckan
Group=ckan
Type=forking
TimeoutSec=0
<?php
namespace Application\WebServices;
/**
*
* @author LeonanCarvalho <j.leonancarvalho@gmail.com>
*/
abstract class AbstractSoapClient {
<?php
namespace Application\Tasks;
/**
* AsyncTaskAbstract allows to fork a php process running at PHP-FPM to do AsyncTasks
* (Not tested with php-cgi, and probaly will not work with Apache mod_php and php-single-worker)
* @requeriment PCNTL Process Control http://php.net/manual/pt_BR/book.pcntl.php
* @requeriment POSIX http://php.net/manual/pt_BR/book.posix.php
* @requeriment Semaphore, Shared Memory and IPC http://php.net/manual/pt_BR/book.sem.php
@LeonanCarvalho
LeonanCarvalho / cache-service-worker.js
Last active April 7, 2021 05:37
Cache service worker
/* global caches, Promise */
//Arquivo apenas para facilitar a edição do javascript, deve ser colado no .php// Não minificar
importScripts('serviceworker-cache-polyfill.js');
// While overkill for this specific sample in which there is only one cache,
// this is one best practice that can be followed in general to keep track of
// multiple caches used by a given service worker, and keep them all versioned.
// It maps a shorthand identifier for a cache to a specific, versioned cache name.
{
"id": "df72dc57-1eb9-42a3-88a9-8647ecc954b4",
"type": "GenericEntity",
"dateCreated": {
"value": "2017-02-10T19:20+10:03",
"type": "DateTime"
},
"dateModified": {
"value": "2017-02-15T22:02+01:51",
"type": "DateTime"
@LeonanCarvalho
LeonanCarvalho / ckan_lighttpd_vhost.conf
Last active February 8, 2017 20:24
Solr 5.5.3 CKAN core schemas
# CKAN lighttpd vhost
# server.modules += ( "mod_proxy" )
$HTTP["host"] == "ckan.example.com"{
proxy.server = ( "" =>
( "" =>
("host" => "127.0.0.1", "port" => 5000)
)
)
}
This file has been truncated, but you can view the full file.
Downloading/unpacking argparse==1.4.0 (from -r default/src/ckan/requirements.txt (line 7))
Getting page https://pypi.python.org/simple/argparse/
URLs to search for versions for argparse==1.4.0 (from -r default/src/ckan/requirements.txt (line 7)):
* https://pypi.python.org/simple/argparse/1.4.0
* https://pypi.python.org/simple/argparse/
Getting page https://pypi.python.org/simple/argparse/1.4.0
Could not fetch URL https://pypi.python.org/simple/argparse/1.4.0: HTTP Error 404: Not Found
Will skip URL https://pypi.python.org/simple/argparse/1.4.0 when looking for download links for argparse==1.4.0 (from -r default/src/ckan/requirements.txt (line 7))
Analyzing links from page https://pypi.python.org/simple/argparse/
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.servlet.http.HttpServletRequest;
//...
<?php
/**
* Description of ResultSet:
* This class handler a paginated Cassandra\FutureRows
*
* @author Leonan Carvalho
*/
class ResultSet {
@LeonanCarvalho
LeonanCarvalho / mysql_linux_backup.php
Last active December 11, 2015 13:07
PHP Script That provide a easy way to safe backup your databases
<?php
/* =========================================================
* Script to Generate MySQL dumps With PHP
* =========================================================
* Copyright 2015 Leonan Carvalho @leonancarvalho
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*