Skip to content

Instantly share code, notes, and snippets.

View byjg's full-sized avatar

Joao M byjg

View GitHub Profile
{
"module":"App.Home",
"actions":[
{
"type":"update",
"data":{
"title":"bla"
},
"name":"TAG.Controls.Body"
},
<?php
$string = "This is a example with special “quotes” and ‘single quotes’";
echo $string . "\n";
echo fixcurly($string) . "\n";
function fixcurly($string)
{
@byjg
byjg / default
Last active May 18, 2016 20:23
Default NGINX Setup
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
function add_meta_tags()
{
global $data;
if(!is_null($data['metas']['page_meta_description']) )
{
echo '<meta name="description" content="'.$data['metas']['page_meta_description'].'">';
}
}
add_action('wp_head', 'add_meta_tags');
@byjg
byjg / ansible-summary.md
Created April 12, 2018 01:27 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@byjg
byjg / run.groovy
Created May 12, 2018 22:04
Run Shell Script from Groovy
// Parameters
def cmd = "ls -la"
def workdir = "/home/"
// Code
def sout = new StringBuilder(), serr = new StringBuilder()
def proc = cmd.execute(null, new File(workdir))
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
println "out> $sout err> $serr"
Sub SMS()
Dim Result As String
Result = EnviarSMS("21", "999999999", "Mensagem", "Usuario", "Senha")
MsgBox Result
End Sub
Function RequestURL(Method As String, Dict As Variant) As String
Dim QueryString As String
Dim Key As Variant
#!/usr/bin/env python
""" Print all of the clone-urls for a GitHub organization.
It requires the pygithub3 module, which you can install like this:
$ sudo yum -y install python-virtualenv
$ mkdir scratch
$ cd scratch
$ virtualenv my-virtualenv
$ source my-virtualenv/bin/activate
@byjg
byjg / docker-composer-wordpress.yml
Last active November 1, 2019 02:59
Docker Compose Wordpress (Docker Swarm)
version: '3.2'
services:
wordpress:
image: wordpress:4.8-php7.1
environment:
- WORDPRESS_DB_HOST=mysql-container
- WORDPRESS_DB_USER=user
- WORDPRESS_DB_PASSWORD=password
- WORDPRESS_DB_NAME=wordpress
volumes: