Skip to content

Instantly share code, notes, and snippets.

View thomas-lebeau's full-sized avatar
🐶

Thomas Lebeau thomas-lebeau

🐶
View GitHub Profile
@thomas-lebeau
thomas-lebeau / gist:4451b849778cffbeee3f
Last active October 11, 2015 07:38
JS: share links and counts
<a href="http://twitter.com/home?status=STATUS" title="Click to share this post on Twitter">Share on Twitter</a>
<a href="http://www.facebook.com/sharer.php?u=URL&t=TITLE">link or image</a>
<a href="https://m.google.com/app/plus/x/?v=compose&content=CONTENT">Image or text</a>
Facebook*: https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
Twitter: http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%
Reddit:http://buttons.reddit.com/button_info.json?url=%%URL%%
LinkedIn: http://www.linkedin.com/countserv/count/share?url=%%URL%%&format=json
Digg: http://widgets.digg.com/buttons/count?url=%%URL%%
Delicious: http://feeds.delicious.com/v2/json/urlinfo/data?url=%%URL%%
.hyphenate() {
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word; // Non standard for webkit
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@thomas-lebeau
thomas-lebeau / gist:3e3ff2b32a040cac87e3
Created April 17, 2015 11:29
Makes placeholder disappear immediately on focus
[placeholder]:focus::-webkit-input-placeholder {
color: transparent;
}
@thomas-lebeau
thomas-lebeau / gist:aff093cf6b6386c8fd08
Last active August 29, 2015 14:19
Fire event when window resizing is finished
var resizeId;
$(window).resize(function() {
clearTimeout(resizeId);
resizeId = setTimeout(doneResizing, 500);
});
function doneResizing(){
//whatever we want to do
}
@thomas-lebeau
thomas-lebeau / gist:ae8ba7548c8f89a07b6d
Created April 17, 2015 14:49
Boostrap 3 Media Queries Cheat Sheet
/* no media query is for phone and larger (mobile first) */
@media only screen and (min-width: @screen-sm-min) {} /* tablet (768px) and larger */
@media only screen and (min-width: @screen-md-min) {} /* desktop (992px) and larger */
@media only screen and (min-width: @screen-lg-min) {} /* wide destop (1200px) and larger */
@media only screen and (max-width: @screen-xs-max) {} /* phone (767px) and smaller */
@media only screen and (max-width: @screen-sm-max) {} /* tablet (991px) and smaller */
@media only screen and (max-width: @screen-md-max) {} /* desktop (1199px) and smaller */
/* no media query is also for wide desktop and smaller */
@thomas-lebeau
thomas-lebeau / user.php
Created April 30, 2015 08:54
Override kirby user field to select current user by default
<?php
class UserField extends SelectField {
public function input() {
$select = new Brick('select');
$select->addClass('selectbox');
$select->attr(array(
'name' => $this->name(),
@thomas-lebeau
thomas-lebeau / gist:fa98c485ab7135cd0473
Last active August 29, 2015 14:24
kirby get first parent
$blog = ($page->parents()->count() > 0)? $page->parents()->first() : $page;
@thomas-lebeau
thomas-lebeau / social-share.js
Created July 17, 2015 15:00
Share to social network
'use strict';
(function () {
/**
* Social share popups
*
*/
var url = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname;
var title = document.getElementsByTagName("title")[0].innerHTML;
@thomas-lebeau
thomas-lebeau / clock.js
Created February 4, 2020 18:26
migracode clock ticking
import React, { Component } from "react";
import ReactDOM from "react-dom";
class Time extends Component {
constructor(props) {
super(props);
this.state = {
date: new Date(),
count: 0
};
import React, { Component } from "react";
import ReactDOM from "react-dom";
function Todo(props) {
const { text, isDone, onToggle } = props;
const style = isDone ? { color: "grey", textDecoration: "line-through" } : {};
return (
<li>
<input