Skip to content

Instantly share code, notes, and snippets.

Working from home

Sérgio Jardim sjardim

Working from home
View GitHub Profile
sjardim / ProcessSendApi.php
Last active May 15, 2018
A ProcessWire module to handle API call to a Sendy installation.
View ProcessSendApi.php
<?php namespace ProcessWire;
class ProcessSendyAPI extends WireData implements Module, ConfigurableModule
public static function getModuleInfo()
return array(
'title' => __('Process Sendy API'),
'summary' => __('Handle API calls to a Sendy installation'),
sjardim / settings.json
Created Apr 24, 2018
VS Code Settings
View settings.json
// Place your settings in this file to overwrite the default settings
"": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"editor.accessibilitySupport": "off",
"editor.lineHeight": 30,
"files.associations": {
"*.module": "php",
"*.latte": "smarty"
"editor.cursorStyle": "line",
View ProcessWire Nginx configuration on Laravel Forge
include forge-conf/*;
server {
return 301 https://$server_name$request_uri;
server {
listen 443 ssl http2;
View import-content-wordpress-to-processwire.php
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Import Books</title>
<table border='1' width='100%'>
sjardim / export_grouped_objects_coordinates.jsx
Last active Mar 2, 2016
Export to txt a list of grouped objects and their coordinates in Adobe Indesign (tested on CS6)
View export_grouped_objects_coordinates.jsx
//Download sample file:
app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
var myDocument = app.activeDocument;
var activeLayer = myDocument.activeLayer;
if(!activeLayer.visible) {
alert("The selected layer: '"+ +"' is not visible." + '\n' + "Make it visible and try again."); exit();
} else {
View A1_format_calendar.tex
% DIN-A4 doublesided year calendar
% Author: Robert Krause
% Modified by: Sérgio Jardim (@sjardim)
% License : Creative Commons attribution license
% Submitted to on 13 July 2012
\usepackage{tikz} % Use the calendar.sty style
View sent-mail-text-file-en_outlook-multiple-cc-addresses.scpt
set people2Send to {} -- start off with an empty list
--set the path to your plain text file with addresses, and name, tab delimited
--change the username
set everybody to read file ("Macintosh HD:Users:sjardim:people_to_send.txt")
--set the path to the pdf files. The TXT file MUST be saved in Mac OS Roman encoding
set rootPath to "/Users/sjardim/pdf/"
set pcount to count paragraphs in everybody
sjardim / Laravel_Factory_Relationships.php
Created Sep 4, 2015
Create post factory with relationships fields
View Laravel_Factory_Relationships.php
//create 15 posts with 3 comments and 3 tags each
$posts = factory('App\Post', 15)
->each(function($post) {
foreach(range(1,3) as $v){
View gulpfile.js
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
csso = require('gulp-csso'),
uglify = require('gulp-uglify'),
jade = require('gulp-jade'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'), // Livereload plugin needed:
tinylr = require('tiny-lr'),
express = require('express'),
sjardim / AdminThemeReno.css
Created Jun 12, 2015
CSS filters do create a dark version of ProcessWire Admin Reno Theme
View AdminThemeReno.css
body {background: #222}
#main {-webkit-filter: invert(100%) contrast(70%) hue-rotate(0deg)}
#sidebar {-webkit-filter: invert(100%) contrast(90%)}
.notes {-webkit-filter: hue-rotate(90deg)}
#sidebar #main-nav a.current:not(.parent) {-webkit-filter: hue-rotate(120deg)}
.ui-button-text, .InputfieldImagePreview {-webkit-filter: invert(100%)}