Skip to content

Instantly share code, notes, and snippets.

View cesjam7's full-sized avatar
🍊
Working from home

César Jefferson Aquino Maximiliano cesjam7

🍊
Working from home
View GitHub Profile
@cesjam7
cesjam7 / single.php
Created April 5, 2018 18:10
Listar cuatro eventos relacionados al evento que estoy mostrando
<?php
$query = new WP_Query(array(
"post_type" => "evento",
"cat" => 2,
"post__not_in" => array( get_the_id() ),
"showposts" => 4
));
if ($query->have_posts()) {
while ($query->have_posts()) { $query->the_post();
the_title();
@cesjam7
cesjam7 / index.php
Created April 5, 2018 18:05
Listar tus 10 últimos posts.
<?php
$query = new WP_Query(array(
"showposts" => 10
));
if ($query->have_posts()) {
while ($query->have_posts()) { $query->the_post();
the_title();
echo "<hr>";
}
}
$(document).ready(function() {
$(".submit_btn_enviar").click(function(evt) {
evt.preventDefault();
var postid = $(this).attr('data');
var id = jQuery("#idpost-" + postid).val();
alert(id);
<?php
/*
Template Name: Plantilla trabaja con nosotros
*/
get_header();
$args_puestos_trabajo = array(
'post_type' => 'trabajo',
'order' => 'ASC',
'posts_per_page' => -1,
@cesjam7
cesjam7 / app1.js
Last active November 29, 2016 19:20
Leer el API de Spotify con Node JS
var https = require('https');
var search = 'my way calvin harris';
var type = 'track';
// Traemos los datos
var request = https.get("https://api.spotify.com/v1/search?q=" + search + "&type=track", function(response) {
var output = '';
response.on('data', function (result) {
// Guardamos los datos recibidos en una variable
output += result;
@cesjam7
cesjam7 / comentario.html
Created November 22, 2016 01:20
Simulación de comentarios en AJAX
<!-- Traemos los estilos de Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- Ingresamos una simulación de alguna publicación -->
<div class="panel panel-primary">
<div class="panel-heading">La Kimberly</div>
<div class="panel-body">
Me volvieron a dejar en visto :( #soloquedallorar
</div>
</div>
@cesjam7
cesjam7 / app.js
Created November 15, 2016 03:02
aplicacion buscar spotify
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
function BuscarSpotify(busqueda) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
@cesjam7
cesjam7 / app.js
Created November 8, 2016 03:01
Notas en Nodejs
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<div className="App-header">
<img src={logo} className="App-logo" alt="logo" />
@cesjam7
cesjam7 / app.js
Created September 20, 2016 03:07
Rutas dinámicas y vistas con Angular 1.x
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider){
$routeProvider
.when("/home", {
controller: "inicio",
templateUrl: "home.html"
})
.when("/nosotros/:name", {
controller: "nosotros",
@cesjam7
cesjam7 / tareas.html
Created August 30, 2016 03:03
Lista de tareas con Angular JS sin tocar JavaScript
<html ng-app>
<head>
<title>Lista de tareas</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<style>
.tachar { text-decoration: line-through; }
</style>
</head>
<body ng-init="homework = []">