Skip to content

Instantly share code, notes, and snippets.

View revolunet's full-sized avatar
🐫
Killing bugz

Julien Bouquillon revolunet

🐫
Killing bugz
View GitHub Profile
@revolunet
revolunet / colorpicker.html
Created April 3, 2013 10:43
Sample AngularJS colorpicker example
<!doctype html>
<html ng-app="MyApp" >
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.1/angular.js"></script>
<script type="text/javascript">
var app = angular.module('MyApp', []);
app.directive('colorpicker', function($parse) {
// sample color picker directive
// todo : bound to a ng-model
@revolunet
revolunet / virtualenv.sh
Created April 8, 2013 15:05
simple virtualenv setup
# creates a fresh new virtualenv and activates it
mkvirtualenv --no-site-packages ProjectName
# add requirements
pip install dotcloud fabric
# backup in requirements file
pip freeze > requirements.txt
@revolunet
revolunet / sketchfab.py
Created April 12, 2013 23:59
sample sketchfab API upload
# -*- encoding: UTF-8 -*-
import os
# pip install requests if not installed
import requests
def sketchfab_send(fullpath, title, tags='', description=''):
''' sends a 3D model to the sketchfab API '''
url = 'https://api.sketchfab.com/v1/models'
token_api = '123abc'
private = 1
@revolunet
revolunet / .auto_virtualenv.sh
Created April 21, 2013 11:45
automatic virtualenv discovery & activation on path change.
#
# adapted from http://www.burgundywall.com/tech/automatically-activate-virtualenv
# source this in your .bash_profile and you're done
#
# todo: ability to set a different virtualenv name
#
export PREVPWD=`pwd`
export PREVENV_PATH=
@revolunet
revolunet / landing-pages.md
Last active February 28, 2018 05:01
Beautiful SAAS landing pages
@revolunet
revolunet / angular-google-analytics.js
Last active December 16, 2015 23:30
Sample angular-google-analytics usage
var app = angular.module('app', ['angular-google-analytics'])
.config(function(AnalyticsProvider) {
// initial configuration
AnalyticsProvider.setAccount('UA-XXXXX-xx');
// track all routes (or not)
AnalyticsProvider.trackPages(true);
}))
.controller('SampleController', function(Analytics) {
// create a new pageview event
@revolunet
revolunet / dabblet.css
Created May 23, 2013 12:12
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body, html {
height:100%;
}
.d1 {
top:200px;
width:30%;
height:300px;
@revolunet
revolunet / dabblet.css
Created May 23, 2013 12:17
absolute positionned children
/**
* absolute positionned children
*/
.d1 {
top:60px;
width:30%;
height:0;
background:pink;
vertical-align:bottom;
display: inline-block;
@revolunet
revolunet / bluetooth.js
Created May 28, 2013 19:38
Chrome Packaged app Bluetooth API example
/*
Chrome Packaged app Bluetooth API test
Before interacting with a BT device, you need to :
1) get the device MAC and service UUID with startDiscovery and getServices methods
2) request permission with chrome.permissions.request
3) add the service profile with chrome.bluetooth.addProfile (a profile is only {uuid:'xxxxxxx...'})
*/
// onConnection callback
chrome.bluetooth.onConnection.addListener(
@revolunet
revolunet / slice.js
Last active May 1, 2021 09:02
Python-like JS slice
'use strict';
/**
* @ngdoc function
* @name ng.filter:slice
* @function
*
* @description
* Creates a new array limited to the specified range, and optionnaly extracts only n-th items
* with the `step` argument, similar to Python slice operators.