This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in a browser | |
var RegExp = "Hello!"; | |
console.log(window.RegExp); // "Hello!" | |
var ncz = "Hi!"; | |
console.log(window.ncz); // "Hi!" | |
// in a browser | |
let RegExp = "Hello!"; | |
console.log(RegExp); // "Hello!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GenericEncoder | |
{ | |
private $encoderFactory; | |
public function __construct( | |
EncoderFactory $encoderFactory | |
){ | |
$this->encoderFactory = $encoderFactory; | |
} | |
public function encodeToFormat($data, string $format): string | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Formik, Form, Field, FieldArray } from 'formik'; | |
import styled from 'styled-components'; | |
const languageState = [true]; | |
export default () => { | |
const handleSubmit = values => { | |
console.log(values.languages); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import FeedbackMessage from './FeedbackMessage' | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<FeedbackMessage name="@SoyLuisCorona Follome" app="My App React" /> | |
</div> | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some variables we need throughout | |
var editor, statusline, savebutton, idletimer; | |
// The first time the application loads | |
window.onload = function() { | |
// Initialize local storage if this is the first time | |
if (localStorage.note == null) localStorage.note = ""; | |
if (localStorage.lastModified == null) localStorage.lastModified = 0; | |
if (localStorage.lastSaved == null) localStorage.lastSaved = 0; | |
// Find the elements that are the editor UI. Initialize global variables. | |
editor = document.getElementById("editor"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function UserDataStorage(maxage) { | |
// Create a document element and install the special userData | |
// behavior on it so it gets save() and load() methods. | |
var memory = document.createElement("div"); // Create an element | |
memory.style.display = "none"; // Never display it | |
memory.style.behavior = "url('#default#userData')"; // Attach magic behavior | |
document.body.appendChild(memory); // Add to the document | |
// If maxage is specified, expire the userData in maxage seconds | |
if (maxage) { | |
var now = new Date().getTime(); // The current time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = localStorage.username; // Query a stored value. | |
name = localStorage["username"]; // Array notation equivalent | |
if (!name) { | |
name = prompt("What is your name?"); // Ask the user a question. | |
localStorage.username = name; // Store the user's response. | |
} | |
// Iterate through all stored name/value pairs | |
for(var name in localStorage) { // Iterate all stored names | |
var value = localStorage[name]; // Look up the value of each one | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Startup | |
{ | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
} | |
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | |
puplic void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
{ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GenericEncoder | |
{ | |
private function prepareData($data, string $format) | |
{ | |
switch ($format) { | |
case 'json': | |
$data = $this->forceArray($data); | |
$data = $this->fixKeys($data); | |
// fall through | |
case 'xml': |