Skip to content

Instantly share code, notes, and snippets.

View eduardnow's full-sized avatar

Eduard Castro eduardnow

View GitHub Profile
@eduardnow
eduardnow / chmod-400.cmd
Created May 29, 2020 21:36 — forked from jaskiratr/chmod-400.cmd
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
{
"ns1:collectResponse": {
"collectResult": {
"requestId": {
"@xsi:nil": "true"
},
"status": {
"status": "FAILED",
"reason": "0",
"message": "No se ha proporcionado nombre de navegador",
<env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wssu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p2p="http://placetopay.com/soap/redirect/">
<env:Header>
<wsse:Security env:mustUnderstand="true">
<wsse:UsernameToken>
<wsse:Username>6dd490faf9cb87a9862245da41170ff2</wsse:Username>
@eduardnow
eduardnow / soap.php
Last active December 30, 2016 00:34
cliente soap php
<?php
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl', 900);
ini_set('default_socket_timeout', 15);
$params = array(
'passport' => '',
'password' => '',
@eduardnow
eduardnow / modernizr-windows.js
Created December 11, 2016 16:19
bower - modernizr en windows
//Dar permisos a la carpeta npm para ejecutar como admin
npm install
node .\bin\modernizr -c .\lib\config-all.json
@eduardnow
eduardnow / wp_ajax.php
Created November 29, 2016 12:27
wp ajax (action)
<?php
//https://codex.wordpress.org/Plugin_API/Action_Reference/wp_ajax_(action)
/*The wp_ajax_ hook only fires for logged-in users.
If you need to also listen for Ajax requests that don't come from logged-in users,
you need to use wp_ajax_nopriv_, like this: add_action( 'wp_ajax_nopriv_add_foobar', 'prefix_ajax_add_foobar' );.
*/
add_action( 'wp_ajax_add_foobar', 'prefix_ajax_add_foobar' );
add_action( 'wp_ajax_nopriv_add_foobar', 'prefix_ajax_add_foobar' );
@eduardnow
eduardnow / class.cs
Created November 28, 2016 19:24
Create Instance String c#
string name = "System.Windows.Forms" + "." + "Label";
var textBoxType = typeof(Control).Assembly.GetType(name, true);
var textBox = Activator.CreateInstance(textBoxType);
@eduardnow
eduardnow / gist:6d14ad0c05ee3f94290260757f835fc8
Last active September 27, 2016 15:35
ACF query_post orderby_meta pagination
<?php
$posts = get_posts(array(
'numberposts' => 12,
'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
'post_type' => 'product',
'meta_key' => 'brand',
'orderby' => 'meta_value',
'order' => 'ASC',
));
@eduardnow
eduardnow / 0_reuse_code.js
Created June 27, 2016 16:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console