Skip to content

Instantly share code, notes, and snippets.

View Art2B's full-sized avatar

Arthur Battut Art2B

View GitHub Profile
@Art2B
Art2B / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Art2B
Art2B / gist:2f738b159565426d758f
Created March 23, 2015 17:14
array of name for svg <3
var objectsToClick = ['Objet-1', 'Objet-2', 'Objet-3', 'Objet-5',
'right-object-1', 'right-object-2', 'right-object-3', 'right-object-4', 'right-object-5', 'right-object-6a', 'right-object-7'];
var numberToClick = ['No-1', 'No-2', 'No-3', 'No-5',
'right-No-1', 'right-No-2', 'right-No-3', 'right-No-4', 'right-No-5', 'right-No-6', 'right-No-7'];
var lines = ['line-1', 'line-2', 'line-3', 'line-5', 'right-line-1', 'right-line-2', 'right-line-3', 'right-line-4', 'right-line-5', 'right-line-6', 'right-line-7'];
var lineTops = ['line-1-top', 'line-2-top', 'line-3-top', 'line-5-top', 'right-line-1-top', 'right-line-2-top', 'right-line-3-top', 'right-line-4-top', 'right-line-5-top', 'right-line-6-top', 'right-line-7-top' ];
var lineBottoms = ['line-1-bottom', 'line-2-bottom', 'line-3-bottom', 'line-5-bottom', 'right-line-1-bottom', 'right-line-2-bottom', 'right-line-3-bottom', 'right-line-4-bottom', 'right-line-5-bottom', 'right-line-6-bottom', 'right-line-7-bottom'];
@Art2B
Art2B / checkEmpty.js
Last active August 29, 2015 14:21
Check empty elements
$('p,em,b,strong,i,span,h1,h2,h3,h4,h5,h6,li').each(function() {
if($(this).text().length == 0 && $(this).children().length == 0){
console.log('Empty Element',$(this));
}
});
@Art2B
Art2B / treejs_work.js
Last active August 29, 2015 14:23
Workaround with three.js
<!DOCTYPE html>
<html>
<head>
<title>My first Three.js app</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>
<body>
var SerialPort = require("serialport").SerialPort;
var serialPort = new SerialPort("/dev/ttyACM0", {
baudrate: 9600,
});
var buffer;
serialPort.on("open", function () {
console.log('open');
serialPort.on('data', function(data) {
@Art2B
Art2B / .explications_wp.md
Last active February 5, 2016 19:28
Easy Wordpress with Apache2 on Ubuntu

#Easy Wordpress with Apache on Ubuntu

For the following instructions, I've use apache2 with ubuntu 14.04. The objective here is to setup quickly a wordpress site with a local domain name.

Create your Virtual host

Personnaly I follow this tutorial (french only). For your conf file, Copy the conf file I've uploaded.

##Setup Apache2 mod You need to enable mod_rewrite on apache to allow you to choose whatever url style you want. To do this run a2enmod rewrite then restart apache.

@Art2B
Art2B / .vimrc
Created April 18, 2018 15:10
My vim config
execute pathogen#infect()
syntax on
filetype plugin indent on
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
@Art2B
Art2B / .stylelintrc
Last active August 31, 2018 12:45
Personnal favorite .stylelintrc for style formatting
{
"plugins": [
"stylelint-order"
],
"rules": {
"order/order": [
[
"dollar-variables",
{
"type": "at-rule",
@Art2B
Art2B / Explanations.md
Last active October 24, 2018 08:56
Sweet icons stuff with sass

Sass needed

// Icon font name
$font-family-icon: 'icomoon';

// Icons declaration
$icons-list: (
  "instagram": "\e913",
  "twitter": "\e912",
@Art2B
Art2B / .stylelintrc
Last active November 27, 2018 14:19
Npm build scripts
{
"ignoreFiles": ["**_variables.scss"],
"plugins": [
"stylelint-order"
],
"rules": {
"order/order": [
[
"dollar-variables",
{