Skip to content

Instantly share code, notes, and snippets.

@AJLeonardi
AJLeonardi / btn_group.css
Created March 20, 2018 16:52
Simple Button Group for Materialize
.btn-group {
position: relative;
display: -ms-inline-flexbox;
display: inline-flex;
vertical-align: middle;
}
.btn-group>.btn:first-child:not(:last-child) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
@ajaxray
ajaxray / select2-cascade.js
Last active November 23, 2022 07:27
Making Select2 (4.x) list boxes cascading / dependent. Options of a select2 list box will be loaded/refreshed by ajax based on selection of another select2 list box.
/**
* A Javascript module to loadeding/refreshing options of a select2 list box using ajax based on selection of another select2 list box.
*
* @url : https://gist.github.com/ajaxray/187e7c9a00666a7ffff52a8a69b8bf31
* @auther : Anis Uddin Ahmad <anis.programmer@gmail.com>
*
* Live demo - https://codepen.io/ajaxray/full/oBPbQe/
* w: http://ajaxray.com | t: @ajaxray
*/
var Select2Cascade = ( function(window, $) {
@emeeks
emeeks / README.md
Last active June 11, 2022 18:42
circularbrush.filter

The earlier example of this brushable radial chart led to some feedback to make the filtering better. I introduced a #circularBrush.filter(array,accessor) that takes an array of data and and accessor for that data and returns to you the data that falls into the area of the brush. The functionality of this chart is no different than the other, but if you take a look at the code, it's much more efficient.

import base64
import os
import mimetypes
from django.core.files.uploadedfile import SimpleUploadedFile
from tastypie import fields
class Base64FileField(fields.FileField):
"""
A django-tastypie field for handling file-uploads through raw post data.
@kerryrodden
kerryrodden / .block
Last active April 22, 2024 19:24
Sequences sunburst
license: apache-2.0
@phoebebright
phoebebright / index.html
Created November 5, 2012 16:35
D3 to nest or not to nest selections - examples
<!DOCTYPE html>
<html>
<head>
<title>Map</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
.one {
background: #a7eea4;
}
.two {
@elmarcoh
elmarcoh / table_init.js
Created October 26, 2012 21:35
Using Tastypie as an Ajax Source for DataTables
$('#participantes-table').dataTable({
bProcessing: true,
bServerSIde: true,
sAjaxSource: "/path/to/your/tastypie/api/list/objects/?format=json",
sAjaxDataProp: "objects",
aoColumns: [
// Put the resource name that corresponds to each table column
{'mData': "your"},
{'mData': "columns"},
],
@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@enjalot
enjalot / _.md
Created September 6, 2012 03:28
color scales
@mbostock
mbostock / .block
Last active December 6, 2019 22:03
Circular Segment
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/circular-segment