Skip to content

Instantly share code, notes, and snippets.

View felipegenuino's full-sized avatar
🇧🇷
Hello from Brazil

Felipe Genuino felipegenuino

🇧🇷
Hello from Brazil
View GitHub Profile
<script>
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if(xhr.readyState === 4){
document.getElementById('ajax').innerHTML = xhr.responseText;
}
};
xhr.open('GET','sidebar.html');
xhr.send();
@felipegenuino
felipegenuino / ajax.js
Created March 29, 2015 22:30
Começando com Ajax
<script>
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if(xhr.readyState === 4){
document.getElementById('ajax').innerHTML = xhr.responseText;
}
};
xhr.open('GET','sidebar.html');
xhr.send();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href='//fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css">
<title>AJAX with JavaScript</title>
<script>
<?php
$var = get_sub_field('acf_field');
switch ($var) {
case 'radio-item-1':
# code...
break;
case 'radio-item-2':
//: Playground Swift - Login e senha
import UIKit
var username = "design@felipegenuino.com"
var password = "1234"
if username == "design@felipegenuino.com" && password == "1234"{
print("Acesso liberado")
} else if username != "design@felipegenuino.com" && password != "1234" {
var numeroAleatorio = Int(arc4random_uniform(6)+1)
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
self.view.endEditing(true)
}
func textFieldSholdReturn(textField:UITextField!) -> Bool {
//nomeDoCampo é o text field que vamos trabalhar
nomeDoCampo.resignFirstResponder()
return true
}
//
// ViewController.swift
// baixando-conteudo-da-web
//
// Created by Felipe Genuino on 29/12/15.
// Copyright © 2015 Felipe Genuino. All rights reserved.
//
import UIKit
//
// ViewController.swift
// mapa
//
// Created by Felipe Genuino on 31/12/15.
// Copyright © 2015 Felipe Genuino. All rights reserved.
//
import UIKit
import MapKit