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
"dependencies": { | |
"gatsby": "^2.20.12", | |
"gatsby-plugin-manifest": "^2.1.1", | |
"gatsby-plugin-offline": "^2.1.1", | |
"gatsby-plugin-react-helmet": "^3.0.12", | |
"gatsby-source-filesystem": "^2.0.38", | |
"react": "^16.8.6", | |
"react-dom": "^16.8.6", | |
"react-helmet": "^5.2.1", | |
}, |
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
// This is a proper alternative to | |
// https://github.com/BuckleScript/bucklescript/blob/b9508105b1a35537bdea9a1fabd10f6c65f776b4/jscomp/bsb/templates/react-hooks/src/FetchedDogPictures/FetchedDogPictures.re#L14 | |
// The one in that file uses Promise, but that's *wrong*. | |
// We only used promise as a demo of its API. We'll remove it soon. | |
// As you can see below, the pure XMLHttpRequest code is just as clean, | |
// less mysterious for all, more performant, extensible, and actually correct. | |
// Ignore these externals for now. They're just for illustration | |
// purposes. I just copy pasted the Js code from |
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
package com.thdespou; | |
import java.util.Locale; | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println(Locale.getDefault()); | |
} | |
} |
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
package com.thdespou; | |
import java.time.*; | |
public class Main { | |
public static void main(String[] args) { | |
Instant now = Instant.now(); | |
ZonedDateTime zdt = ZonedDateTime.ofInstant(now, | |
ZoneId.systemDefault()); |
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
package com.thdespou; | |
import java.time.Instant; | |
public class Main { | |
public static void main(String[] args) { | |
Instant now = Instant.now(); | |
System.out.println("Date is " + now); | |
} |
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
package com.thdespou; | |
import java.util.Date; | |
import java.util.TimeZone; | |
public class Main { | |
public static void main(String[] args) { | |
// Date | |
Date now = new Date(); |
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
package com.thdespou; | |
import java.util.Date; | |
public class Main { | |
public static void main(String[] args) { | |
// Date | |
Date now = new Date(); | |
System.out.println("Current Date in milliseconds is :" + now.getTime()); |
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
{% if app.environment == 'translation' %} | |
window.PHRASEAPP_CONFIG = { | |
projectId: "YOUR-PROJECT-ID" | |
}; | |
(function() { | |
var phraseapp = document.createElement('script'); phraseapp.type = 'text/javascript'; phraseapp.async = true; | |
phraseapp.src = ['https://', 'phraseapp.com/assets/in-context-editor/2.0/app.js?', new Date().getTime()].join(''); | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(phraseapp, s); | |
})(); |
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 function process(ContainerBuilder $container) | |
{ | |
if ($this->environment == 'translation') | |
{ | |
$definition = $container->getDefinition('translator.default')->setPublic(true); | |
$definition->setClass('App\AppBundle\PhraseTranslator'); | |
} | |
} |
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
<?php | |
namespace App\AppBundle; | |
use Symfony\Bundle\FrameworkBundle\Translation\Translator as BaseTranslator; | |
class PhraseTranslator extends BaseTranslator | |
{ | |
public function trans($id, array $parameters = array(), $domain = "messages", $locale = null) |