Skip to content

Instantly share code, notes, and snippets.

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

Corentin Hatte viki53

🏠
Working from home
View GitHub Profile
@viki53
viki53 / dabblet.css
Created March 31, 2013 14:17
Easter Eggz
/**
* Easter Eggz
*/
body{
font-family: "Open Sans", Helvetica, Arial, sans-serif;
color: #757575;
}
h1{
text-align: center;
}
@viki53
viki53 / dabblet.css
Created May 1, 2013 22:06
Gangnam Style
/* Gangnam Style */
html{
min-height: 100%;
background-color: #270a52;
background-size: contain;
background-image: radial-gradient(circle closest-side, #5632b8 0%, #270a52 100%);
background-repeat: no-repeat;
}
html::before, html::after{
@viki53
viki53 / dabblet.css
Last active March 23, 2021 14:53
Contenu centré, sidebar externe
/**
* Contenu centré, sidebar externe
*/
#page{
position: relative;
width: 400px;
min-height: 2000px;
margin: 20px auto;
background-color: green;
@viki53
viki53 / dabblet.css
Created May 16, 2013 13:14
Disco fever
/**
* Disco fever
*/
body{
height: 100%;
background-color: black;
perspective: 700px;
}
@viki53
viki53 / dabblet.css
Last active March 23, 2021 15:08
Stylish menu
/**
* Stylish menu
*/
html {
height: 100%;
}
body {
background-color: #f06;
background-image: linear-gradient(0deg, #f06, yellow);
@viki53
viki53 / dabblet.css
Created May 27, 2013 11:47
Gangnam Style
/* Gangnam Style */
html{
min-height: 100%;
background-color: #270a52;
background-size: contain;
background-image: radial-gradient(circle closest-side, #5632b8 0%, #270a52 100%);
background-repeat: no-repeat;
}
html::before, html::after{
@viki53
viki53 / dabblet.css
Created May 27, 2013 12:08
Shake ton <body>
/* Shake ton <body> */
html{
height: 100%;
background-color: #69c3fb;
background-size: contain;
background-image: radial-gradient(circle closest-side, #ccebfe 0%, #69c3fb 100%);
background-repeat: no-repeat;
}
<?php
$lang = '';
if(!empty($_SERVER['PATH_INFO']) && strlen($_SERVER['PATH_INFO']) >= 3){
$path_info_lang = substr($_SERVER['PATH_INFO'], 1);
if(preg_match('`^([a-z-]+)$`i', $path_info_lang) && is_file($path_info_lang.'.html')){
$lang = $path_info_lang;
}
}
if(empty($lang) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
preg_match_all("/([[:alpha:]]{1,8})(-([[:alpha:]|-]{1,8}))?"."(\s*;\s*q\s*=\s*(1\.0{0,3}|0\.\d{0,3}))?\s*(,|$)/i", $_SERVER['HTTP_ACCEPT_LANGUAGE'], $accepted_languages, PREG_SET_ORDER);
@viki53
viki53 / api.service.ts
Last active November 17, 2017 15:09
Using Cognito authentication with AWS Cognito in API Gateway
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { AuthGuardService } from './auth-guard.service';
import { AWS_APIGW_ID, AWS_REGION } from '../conf/aws.const';
export const API_ROOT = `https://${AWS_APIGW_ID}.execute-api.${AWS_REGION}.amazonaws.com/prd`;
@Injectable()
export class ApiService {
@viki53
viki53 / time-to-seconds.js
Created March 10, 2020 09:05
input time to seconds
time = input.value; // Ex: '02:30:25'
seconds = time.split(':').reverse().reduce((t, s, i) => { return t + (Math.pow(60, i) * parseInt(s)) }, 0);