Skip to content

Instantly share code, notes, and snippets.

View baptistebriel's full-sized avatar

Baptiste Briel baptistebriel

View GitHub Profile
{
"theme": "Spacegray.sublime-theme",
"color_scheme": "Packages/Sparkk.tmTheme",
"font_face": "Monaco",
"font_size": 13.0,
"font_options":["no_round","no_bold","subpixel_antialias"],
"open_files_in_new_window": false,
"ignored_packages":["Vintage"],
"tab_size": 5,
"word_wrap": false,
@baptistebriel
baptistebriel / admin.php
Last active August 26, 2022 10:14
[WordPress] - Collection of WordPress Snippets
<?php
// Show something only if the user is logged / admin.
// To be used in the current theme files - front.
if (current_user_can('manage_options')){ ?>
<div class="work">
<div class="work_layer">
<div class="device-content row">
<div class="work_content right">
<span class="f_13 uppercase sub_title">Web</span>
@baptistebriel
baptistebriel / _fonts.less
Last active August 29, 2015 13:57
[LESS] - CSS config.
/* -----
Typography, WebFonts
----- */
@baptistebriel
baptistebriel / modules.md
Last active September 18, 2021 09:18 — forked from mattdesl/modules.md
@baptistebriel
baptistebriel / orientation.js
Last active August 29, 2015 14:14
screen.orientation
if (screen.lockOrientation) {
screen.lockOrientation('portrait-primary');
}
else if (screen.mozLockOrientation) {
screen.mozLockOrientation('portrait-primary');
}
else if (screen.orientation && screen.orientation.lock) {
screen.orientation.lock('portrait-primary');
}

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.

// source: https://plus.google.com/+AddyOsmani/posts/TanDFKEN9Kn
var _log = console.log;
console.log = function() {
_log.call(console, '%c' + [].slice.call(arguments).join(' '), 'color:transparent;text-shadow:0 0 2px rgba(0,0,0,.5);');
};
@baptistebriel
baptistebriel / gist:29e761fbc7cc5923cf6b99444a2935c4
Created August 9, 2017 17:44
compress mp4 video using ffmpeg
// http://ericholsinger.com/install-ffmpeg-on-a-mac
ffmpeg -i input.mp4 -vcodec h264 -acodec mp3 output.mp4
@baptistebriel
baptistebriel / index.js
Created December 14, 2017 23:19 — forked from lancejpollard/index.js
webgl basics
var vs = document.getElementById('vs').textContent;
var fs = document.getElementById('fs').textContent;
var canvas = document.querySelector('canvas');
var ctx = canvas.getContext('experimental-webgl', {
alpha: false,
antialias: true,
premultipliedAlpha: false,
stencil: true
});
@baptistebriel
baptistebriel / frag
Created September 26, 2018 17:06 — forked from Samsy/frag
triangle
uniform sampler2D tex;
varying vec2 vUv;
void main() {
gl_FragColor = texture2D( tex, vUv );
}