Having the following structure:
/app
|____/config/
|____endpoints.json
|____/endpoints/
|
|____/module1/
| |____contacts.json
| |____agendas.json
<?php | |
abstract class modBreakingNews | |
{ | |
public function getArticles(&$params) | |
{ | |
$db =& JFactory::getDbo(); | |
$application =& JFactory::getApplication(); | |
$applicationParams = $application->getParams(); | |
$model = JModel::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); |
<?php | |
/** | |
* Formatter interface. | |
* | |
* A contract to format. | |
* | |
* @category Formatter | |
* @package Formatter | |
* @author Saul Martinez <[email protected]> | |
* @copyright 2012 Shark Web Intelligence |
try { | |
$fecha = date('Y-m-d'); | |
$mensajeId = mysql_insert_id(); | |
$path = realpath($_SERVER['DOCUMENT_ROOT'] . DS . '..' . DS . 'adjuntos'); | |
$path = $path . DS . implode(DS, explode('-', $fecha)) . DS . $mensajeId; | |
if (!file_exists($path)) { | |
mkdir($path, 0777, true); | |
} | |
$file = $_FILES['archivo_adjunto']; |
Having the following structure:
/app
|____/config/
|____endpoints.json
|____/endpoints/
|
|____/module1/
| |____contacts.json
| |____agendas.json
# | |
# voipmonitor.org configuration file | |
# | |
# location of this file is at ~/.voipmonitor.conf or /etc/voipmonitor.conf | |
# command line parameters overrides configuration directives in this file | |
# allowed comments are ; or #. | |
# | |
[general] |
class SegmentTree | |
class Segment | |
attr_reader :range, :value | |
def initialize range, value | |
raise ArgumentError, 'Range expected, %s given' % range.class.name unless range.is_a?(Range) | |
@range, @value = range, value | |
end |
module CrudManagement | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def crudify(resource_name, model_name = nil, options = {}) | |
model_name ||= resource_name | |
options[:plural_name] ||= resource_name.to_s.pluralize | |
options[:singular_name] ||= resource_name.to_s.singularize | |
options[:permitted_params] ||= [] |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.
Most the credit for these changes go to Dave Holland.
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |