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');
<!-- Start Audima Widget Injection -->
<div id="audimaWidget"></div>
<script src="//audio.audima.co/audima-widget.js"></script>
<!-- End Audima Widget Injection -->
<!-- Audima CSS Customization -->
<style>
#audimaWidget .audima-panel {
/* Insira aqui a customização exemplo:
background-color: silver;
@byjg
byjg / NoVNC_Paste.js
Last active November 24, 2023 05:46
How to Paste code to NoVNC.
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
window.sendString = function (str) {
f(str.split(""));
function f(t) {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);
@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