Skip to content

Instantly share code, notes, and snippets.

View epok07's full-sized avatar

Franck E. epok07

  • Astrio Sarl
  • Douala
View GitHub Profile
@epok07
epok07 / gist:40e7b5b0560a90e4de18d15c15be4b11
Created April 4, 2021 03:29 — forked from nedSaf/gist:41fb11d4413b2a307266
Adding Leaflet-image to Leaflet-angular-directive
L_PREFER_CANVAS = true;
leafletData.getMap().then(function(map) {
leafletImage(map, function(err, canvas) {
var img = document.createElement('img');
var dimensions = map.getSize();
img.width = dimensions.x;
img.height = dimensions.y;
img.src = canvas.toDataURL();
@epok07
epok07 / Wget_mirror_site.md
Created April 12, 2019 03:03
Make Offline Mirror of a Site using `wget`
@epok07
epok07 / dump.sh
Created June 15, 2018 17:56 — forked from andsens/dump.sh
Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others
@epok07
epok07 / CarbonCheatSheet_01.md
Last active April 5, 2022 15:01
Carbon CheatSheet

Source

Get the first Monday of a month (and more)

This is a small cheat sheet for PHP's strtotime function, which can be used to convert textual sentences such as "next Friday" and "last Monday" into UNIX timestamps and formatted dates.

In the examples below, I've used the format "j, d-M-Y", which will give you something like: Monday, 17-Aug-2015. You can change this to your format of choice

module.exports = {
"globDirectory": "build/",
"globPatterns": [
"**/*.{css,html,js}"
],
"swDest": "build/sw.js",
"swSrc": "src-sw.js"
};
echo "Hello Franck! \n\r";
$url = 'https://newsapi.org/v2/top-headlines?' .
'country=us&' .
//'source=techcrunch&' .
'apiKey=b714f12698014cf4aac6cd930ab5ffae';
$topnews = ( json_decode(file_get_contents($url)) );
$json_string = json_encode($topnews, JSON_PRETTY_PRINT);
@epok07
epok07 / seed.php
Created February 9, 2018 05:28 — forked from eirworks/seed.php
A FuelPHP task example for seeding like in the Rails.
<?php
#seeding data
namespace Fuel\Tasks;
class Seed
{
public static function run()
{
$projects = array("Example Project Title"=>"Example Project description that descripting nothing...",
@epok07
epok07 / Sublime Text 3 Build 3103 License Key - CRACK
Last active February 13, 2018 07:14 — forked from svmotha/Sublime Text 3 Build 3103 License Key - CRACK
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
TwitterInc
200 User License
EA7E-890007
1D77F72E 390CDD93 4DCBA022 FAF60790
61AA12C0 A37081C5 D0316412 4584D136
94D7F7D4 95BC8C1C 527DA828 560BB037
D1EDDD8C AE7B379F 50C9D69D B35179EF
@epok07
epok07 / gist:4700304
Created February 3, 2013 02:22
To the Question: List the "Name" and "Salary" of the Profs who teach more than
SELECT
professors.`name`,
SUM(profs.professors.`salary`) AS salary #, count(profs.students.`name`) as "student count"
FROM
professors,
students
CROSS JOIN courses
WHERE
professors.`name` = prof_name
AND students.`name` = stud_name