Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
monsieurX = {'nom': 'X', 'prénom': 'Monsieur', 'age': 47}
print monsieurX['age']
echo "Beams of fire sweep through my head" > hello
@romainberger
romainberger / index.js
Created March 3, 2016 10:27
React-portal-tooltip with Redux
import React from 'react'
import Tooltip from 'react-portal-tooltip'
import {connect} from 'react-redux'
@connect(state => {
return {
hasError: state.get('error'),
}
})
export default class Test extends React.Component {
var c1 = $('#color-1'),
c2 = $('#color-2')
setInterval(function() {
var co1 = c1.css('background-color').replace('rgb(', '').replace(')', '').split(', '),
co2 = c2.css('background-color').replace('rgb(', '').replace(')', '').split(', ')
t1 = 0,
t2 = 0
co1.forEach(function(x) {
t1 += parseInt(x, 10)
})
@romainberger
romainberger / main.js
Created February 24, 2014 22:50
Wordpress admin lightbox function
/**
* Simple wrapper to use the media lightbox in custom scripts
*
* Usage:
*
* openMediaLightbox(function(attachment) {
* // do something with attachment
* })
*/
!function($) {
@romainberger
romainberger / example-plugin.js
Last active August 29, 2015 13:56
Voxel Painter Core plugins
var Stream = require('stream')
, stream = new Stream()
, numberVoxel = 0
var voxelCount = function(studio) {
studio.on('addVoxel', function() {
numberVoxel++
stream.emit('addVoxel', numberVoxel)
})
@romainberger
romainberger / index.html
Last active January 2, 2016 20:19
Angular Qtip2 directive
<a class="icon cool-icon" href="#" qtip data-content="Check out this thing"></a>
@romainberger
romainberger / Sublime Text 2 Preferences
Last active October 12, 2015 19:48
Sublime Text 2 Preferences
{
"auto_indent": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_face": "Menlo Regular",
"font_size": 12.0,
"highlight_modified_tabs": true,
"trim_trailing_white_space_on_save": true,
"translate_tabs_to_spaces": true,