Skip to content

Instantly share code, notes, and snippets.

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

Pierre Renaudin prenaudin

🏠
Working from home
View GitHub Profile
workspace_title = "Alice Walter's Team"
subjects_data = [ { "title": "Lectus Sit Consulting", "description": "risus" }, { "title": "Sociis Ltd", "description": "at" }, { "title": "Tellus Nunc Lectus LLP", "description": "ridiculus mus. Proin vel nisl. Quisque" }, { "title": "Auctor Nunc Nulla Foundation", "description": "malesuada" }, { "title": "Fermentum Risus At Incorporated", "description": "lacus. Aliquam rutrum lorem" }, { "title": "Tellus Phasellus Foundation", "description": "mauris sagittis placerat. Cras dictum ultricies" }, { "title": "Dictum PC", "description": "at sem molestie sodales. Mauris blandit enim consequat" }, { "title": "Adipiscing Consulting", "description": "malesuada. Integer id magna" }, { "title": "Dignissim Limited", "description": "dapibus quam" }, { "title": "Lacus Etiam Bibendum PC", "description": "ut dolor dapibus gravida. Aliquam tincidunt, nunc ac" }, { "title": "Nunc Mauris Company", "description": "congue, elit sed consequat auctor, nunc nulla vulputate dui," }, { "title
@prenaudin
prenaudin / reset-favicon-safari
Created November 9, 2013 08:05
How to reset a favicon of a specific site in Safari ( 5+ ) ?
# Close Safari
$ sqlite3 $HOME/Library/Safari/WebpageIcons.db
# Find the iconID and then copy it
sqlite> select iconID from IconInfo where url='https://mysite.com/favicon.ico';
NNNN
# Delete the icon datas of this icon
sqlite> delete from IconData where iconID=NNNN;
@prenaudin
prenaudin / spinner-test.html
Last active January 4, 2016 08:29
Blue Round Spinner
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Azendoo Blue Spinner</title>
</head>
<body>
<div class="az-spinner"/>
</body>
</html>
@prenaudin
prenaudin / css-rules.js
Created June 25, 2014 15:51
Show Number of CSS Rules on a web page
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@prenaudin
prenaudin / 1 - models-Task.js
Last active June 7, 2016 14:47
Immutable.Record + React + Redux = ❤ - 1
import Immutable from 'immutable';
const TaskRecord = Immutable.Record({
id: null,
done: false,
label: '',
createdAt: null,
updatedAt: null,
})
@prenaudin
prenaudin / models-TaskMap.js
Last active June 3, 2016 13:19
Immutable.Record + React + Redux = ❤ - 2
import Immutable from 'immutable';
const TaskMap = Immutable.OrderedMap;
export default TaskMap;
@prenaudin
prenaudin / reducers-tasks.js
Last active June 9, 2016 09:13
Immutable.Record + React + Redux = ❤ - 3
import { RECEIVED_ENTITIES, DELETE_TASK, TOGGLE_TASK_DONE } from 'constants/ActionsTypes';
import Task from 'models/Task';
import TaskMap from 'models/TaskMap';
const initialState = new TaskMap();
const mergeEntities = (state, newTasks) =>
state.merge(newTasks.map((task) => new Task(task)))
export default (state = initialState, action) =>
@prenaudin
prenaudin / containers-TaskListContainer.js
Last active June 9, 2016 09:13
Immutable.Record + React + Redux = ❤ - 4
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { toggleTaskDone } from 'actions/tasks';
import TaskMap from 'models/TaskMap';
import TaskListLayout from 'components/Task/List/Layout';
const TaskListContainer = ({ onToggleTaskDone, tasks }) => (
<TaskListLayout>
{ tasks.map((task) =>
@prenaudin
prenaudin / components-TaskListItem.js
Last active June 9, 2016 09:07
Immutable.Record + React + Redux = ❤ - 5
import React from 'react';
import Task from 'models/Task';
const TaskListItem = ({ task, onToggleTaskDone }) => (
<div className="task-list-item">
<input
type="checkbox"
checked={task.isDone()}
onChange={onToggleTaskDone}
/>
@prenaudin
prenaudin / Editor.react.js
Last active September 5, 2022 17:36
Add checkboxes to your Draft.js editor - Editor.react.js
import React from 'react';
import { Editor, KeyBindingUtil, getDefaultKeyBinding } from 'draft-js';
import keycode from 'keycode';
import insertCheckbox from 'modifiers/insertCheckbox';
const { hasCommandModifier } = KeyBindingUtil;
function customKeyBindingFn(e) {
if (hasCommandModifier(e) && e.shiftKey && keycode(e) === 'c') {
return 'insert-checkbox';