Skip to content

Instantly share code, notes, and snippets.

View donpadre's full-sized avatar
🏠
Working from home

MARIE-JOSEPH Olivier donpadre

🏠
Working from home
View GitHub Profile
@donpadre
donpadre / keybase.md
Last active November 20, 2019 00:14
keybase.md

Keybase proof

I hereby claim:

  • I am donpadre on github.
  • I am donpadre (https://keybase.io/donpadre) on keybase.
  • I have a public key ASDvyhJexmOimhRZrLW-rsJQrJmHEQ6mITtcQvA4_rNJcAo

To claim this, I am signing this object:

@donpadre
donpadre / _notes.md
Created April 8, 2018 19:09 — forked from sgnl/_notes.md
AJAX with Vanilla Javascript. (XMLHttpRequest)

Short XHR Examples

Examples shown are bare minimum needed to achieve a simple goal.

Resources

  • Google Chrome's Dev Tools' Network Panel c-c-c-c-c-ULTIMATE c-c-c-COMBO!!!
  • requestb.in enpoints for your HTTP Requests as a free service.
@donpadre
donpadre / LoadUserData.php
Created March 31, 2018 09:47 — forked from jmather/LoadUserData.php
How to load users in a fixture
<?php
namespace Application\Sonata\UserBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Application\Sonata\UserBundle\Entity\User;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
@donpadre
donpadre / Contact.php
Last active March 9, 2018 21:15
ContactController
<?php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class Contact
{
/**
*
@donpadre
donpadre / certificate.sh
Created January 16, 2018 10:42 — forked from WebReflection/certificate.sh
A basic Self Signed SSL Certificate utility
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to
@donpadre
donpadre / js-toSlug.js
Created December 11, 2017 23:05 — forked from juanmhidalgo/js-toSlug.js
JavaScript toSlug()
String.prototype.toSlug = function(){
st = this.toLowerCase();
st = st.replace(/[\u00C0-\u00C5]/ig,'a')
st = st.replace(/[\u00C8-\u00CB]/ig,'e')
st = st.replace(/[\u00CC-\u00CF]/ig,'i')
st = st.replace(/[\u00D2-\u00D6]/ig,'o')
st = st.replace(/[\u00D9-\u00DC]/ig,'u')
st = st.replace(/[\u00D1]/ig,'n')
st = st.replace(/[^a-z0-9 ]+/gi,'')
st = st.trim().replace(/ /g,'-');
@donpadre
donpadre / slugify.js
Created December 11, 2017 23:05 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@donpadre
donpadre / index.html
Created December 6, 2017 01:44
Some Articles
<article>
<a href="#">
<div class="article-image">
<img src="https://images.unsplash.com/photo-1467825487722-2a7c4cd62e75?dpr=1&auto=format&fit=crop&w=800&h=600&q=80&cs=tinysrgb&crop=" />
</div>
<div class="article-caption">
<p class="article-date">13.02.17</p>
<h2>An Introduction to Strawberries</h2>
<p class="btn btn-brand article-readmore"><span class="btn btn-brand">Read more</span></p>
</div>
<style lang="sass" scoped>
.app {
position : relative;
width : 100vw;
height : 100vh;
margin : 0 !important;
}
.appbar {
position : absolute;
@donpadre
donpadre / index.html
Created August 24, 2017 10:36
Vue Material Example
<div class="app-viewport" id="file-list">
<md-sidenav class="md-left md-fixed" ref="sidebar">
<md-toolbar class="md-account-header">
<md-list class="md-transparent">
<md-list-item class="md-avatar-list">
<md-avatar class="md-large">
<img src="https://placeimg.com/64/64/people/8" alt="People">
</md-avatar>
<span style="flex: 1"></span>