Skip to content

Instantly share code, notes, and snippets.

View jgb-solutions's full-sized avatar
on to something

Jean Gérard Bousiquot jgb-solutions

on to something
View GitHub Profile
@jgb-solutions
jgb-solutions / Image.ex
Created September 30, 2022 23:19
Photon Image service module in Elixir
defmodule JGBSolutions.Image do
# https://developer.wordpress.com/docs/photon/api/
@photon_hosts ["i0.wp.com", "i1.wp.com", "i2.wp.com", "i3.wp.com"]
def get_photon_url(url, opts \\ []) do
url = Application.get_env(:jgb_solutions, :domain) <> url
if String.starts_with?(url, "http") do
url_without_protocol = make_url_without_protocol(url)
// https://developer.wordpress.com/docs/photon/api/
import Box from '@mui/material/Box'
import type { BoxProps } from '@mui/material'
import type { CSSProperties } from 'react'
// const PHOTON_HOSTS = ['i0.wp.com', 'i1.wp.com', 'i2.wp.com', 'i3.wp.com']
const PHOTON_HOSTS = ['i0.wp.com']
interface Props {
@jgb-solutions
jgb-solutions / _ide_helper.php
Created November 28, 2019 17:45 — forked from barryvdh/_ide_helper.php
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@jgb-solutions
jgb-solutions / LICENCE SUBLIME TEXT
Created February 17, 2018 23:41
Sublime Text 3 Serial key build is 3143
## Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
@jgb-solutions
jgb-solutions / _redirects
Last active February 10, 2018 05:27
Fichye sa a pou mete nan root folder pwojè a pou jere tout wout SPA nan fichye index.html la. Aprè sa pou proxy a tou.
/api/* http://temtek-api.jgbnd.com/:splat 200
/* /index.html 200
@jgb-solutions
jgb-solutions / symlink.sh
Created June 25, 2017 18:32 — forked from bangonkali/symlink.sh
Creating a symlink for visual studio code on mac os x el capitan
@jgb-solutions
jgb-solutions / README.md
Created April 1, 2017 03:53 — forked from leemeichin/README.md
Modulo Liquid filter for Jekyll

Modulo Liquid filter for Jekyll

Got nested columns in your grid-based Jekyll site?

Wondered why you didn't have a way to calculate the modulo inside your posts loop to open and close your 'rows' containing those nested columns?

Add this filter to your _plugins directory, and use it like so:

{{ x | mod:y }}
@jgb-solutions
jgb-solutions / get-fisrt-paragraph.php
Created February 11, 2017 06:44 — forked from banago/get-fisrt-paragraph.php
Get first paragraph from a WordPress post.
<?php
/**
* Get first paragraph from a WordPress post. Use inside the Loop.
*
* @return string
*/
function get_first_paragraph(){
global $post;
$str = wpautop( get_the_content() );
@jgb-solutions
jgb-solutions / youtube-video.php
Created April 11, 2015 21:39
Serving YouTube video dynamically with PHP
<?Php
if ( isset( $_GET['submit'] ) && !empty( $_GET['youtubeID'] ) ) { // check whether the form has been submitted
$youtubeID = $_GET['youtubeID']; // storing the ID in a variable
$embedCode = '<iframe width="854" height="510" src="https://www.youtube.com/embed/' . $youtubeID . '" frameborder="0" allowfullscreen></iframe>'; // YouTube Embed code template
} else {
$embedCode = 'Enter an ID in the form above';
}
<head>
<!-- Foundation CSS CDN -->
<link rel="stylesheet" href="//cdn.jsdelivr.net/foundation/5.0.2/css/foundation.min.css">
<!-- Modernizr CDN -->
<script src="//cdn.jsdelivr.net/foundation/5.0.2/js/vendor/custom.modernizr.js"></script>
<!-- Modernizr local fallback -->
<script>window.Modernizr || document.write('<script src="/local/custom.modernizr.js"><\/script>')</script>
</head>
<body>
<!-- APP CONTENT -->