Skip to content

Instantly share code, notes, and snippets.

🐝
Tinkering with @betagouv

Raphaël Huchet rap2hpoutre

🐝
Tinkering with @betagouv
Block or report user

Report or block rap2hpoutre

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chuckplantain
chuckplantain / executionOrderJestJasmine.js
Created Apr 5, 2018
Execution order of async Jest/Jasmine test code
View executionOrderJestJasmine.js
/**
* Demonstrate execution order of code in Jest/Jasmine
*/
function resolveAfter2Seconds(message) {
return new Promise((resolve) => {
setTimeout(() => {
resolve(message)
}, Math.ceil(Math.random() * 5000))
})
@yann-yinn
yann-yinn / index.jsx
Created Apr 1, 2018
Get content from graphCMS with Next.js
View index.jsx
import React from "react";
import { request, GraphQLClient } from "graphql-request";
export default class HomePage extends React.Component {
static async getInitialProps() {
const query = `{
allPosts {
id
slug
coverImage {
@NoelDeMartin
NoelDeMartin / Browser.php
Created Nov 30, 2017
Laravel Dusk Mail mocking proposal
View Browser.php
<?php
namespace Tests\Browser\Dusk;
use Tests\Testing\MailFake;
use Laravel\Dusk\Browser as BaseBrowser;
class Browser extends BaseBrowser {
public function fake($service) {
@brianboyko
brianboyko / README.md
Last active Aug 3, 2019
VueJS Best Practices Guide
View README.md

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@calebporzio
calebporzio / timer_helpers.php
Last active Aug 18, 2019
A simple helper function and macro for timing php scripts and eloquent queries
View timer_helpers.php
<?php
// Helper function.
if (! function_exists('timer')) {
function timer($expression)
{
$start = microtime(true);
if ($expression instanceof Closure) {
$expression();
View PopularCrates.md
@imliam
imliam / pagination.blade.php
Last active Nov 26, 2018
Laravel 5 - Bootstrap 4 Pagination
View pagination.blade.php
<?php
/*
|--------------------------------------------------------------------------
| Laravel 5, Bootstrap 4 Pagination
|--------------------------------------------------------------------------
|
| A partial view to handle pagination for collections in Laravel's query
| builder or Eloquent ORM, styled with Bootstrap 4.
|
| The pagination displays like the following, where * denotes the current
@forairan
forairan / PhpJava.java
Last active Aug 12, 2019
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
View PhpJava.java
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
View Guide.md

Installing OpenSSL for Rust on Windows with MSVC

When using MSVC Rust on Windows, everything typically works out of the box, up until you decide to do some web stuff with hyper. Suddenly a new dependency, openssl, is failing to build and you have no idea how to fix it. Fortunately this guide is here to save you!

WARNING: OpenSSL 1.1 support was only added in openssl-sys = "0.9". Older versions only support up to OpenSSL 1.0.2. https://github.com/sfackler/rust-openssl/issues/452

  1. First you will need to download and install OpenSSL itself. You can download an installer from http://slproweb.com/products/Win32OpenSSL.html. In particular you want the newest version and not the light version. Make sure it matches the version of Rust you have, if you're using x86_64-pc-windows-msvc you will want Win64, and if you're using i9686-pc-windows-msvc you will want Win32. For the purpose of example I have installed Win64 OpenSSL v1.0.2h.
  2. If all went well you should now have OpenSSL installed somewh
You can’t perform that action at this time.