Skip to content

Instantly share code, notes, and snippets.

View Calvein's full-sized avatar
🐶

François Robichet Calvein

🐶
View GitHub Profile
@Calvein
Calvein / getObjects.js
Created April 29, 2014 04:49
Get all objects from a parse class
// Returned promise
var promise = new Parse.Promise()
// Error function
var error = function() {
console.error('Error:', arguments)
// Break it
response.error('Query failed, check logs')
}
@Calvein
Calvein / app.coffee
Last active August 29, 2015 14:03
Little map animation in D3 (needs https://www.npmjs.org/serveur)
# Size of the map
size = 240
# Zoom level to see all Australia
startScale = 330
# Zoom level when zoomed
zoomedScale = 1330
# Transition duration
duration = 400
projection = d3.geo.mercator()
@Calvein
Calvein / README.md
Created July 5, 2014 09:43
D3 map animation

Map animation in D3.

@Calvein
Calvein / gist:cafd35221b40b741e0da
Created October 27, 2014 22:46
Download all files from a basecamp "View all of these files at once"
var as = document.querySelectorAll('br + a')
for (var i = 0, len = as.length; i < len; i++) {
var a = _ref[i]
a.setAttribute('download', a.textContent)
a.click()
}
div = document.createElement('div')
fakeSvg = '<svg>' + markerIcon + '</svg>'
div.innerHTML = '' + fakeSvg
for el in Array::slice.call(div.childNodes[0].childNodes)
marker.node().appendChild(el)
@Calvein
Calvein / index.coffee
Created January 9, 2015 05:27
Generate readable string
generateTitle = ->
v = 'aeiouy'
c = 'bcdfghjklmnpqrstvwxz'
text = ''
for i in [0..6]
group = if i % 2 then v else c
letter = group.charAt(Math.floor(Math.random() * group.length))
if i is 0
letter = letter.toUpperCase()
@Calvein
Calvein / index.styl
Created March 1, 2015 06:03
Basic css switches (I just needed a checkbox, you might too).
switchHeight = 15px
switchPadding = 2px
switchWidth = 25px
.switch
position absolute
height switchHeight
width switchWidth
top 4px
right 5px
border-top-left-radius 25% 50%
@Calvein
Calvein / data.json
Last active December 8, 2015 22:49
Get pictures and info of Australia's MPs
[
{
"name": "Tony Abbott",
"img": "http://parlinfo.aph.gov.au/parlInfo/download/handbook/allmps/EZ5/upload_ref_binary/EZ5.JPG",
"electorate": "Warringah",
"state": "New South Wales"
},
{
"name": "Anthony Albanese",
"img": "http://parlinfo.aph.gov.au/parlInfo/download/handbook/allmps/R36/upload_ref_binary/R36.jpg",
@Calvein
Calvein / components.styl
Last active September 6, 2016 03:50
Stylus style for react-select (assuming autoprefixer too)
@require 'control'
@require 'menu'
@require 'mixins'
@require 'multi'
@require 'spinner'
@Calvein
Calvein / index.styl
Created October 4, 2016 03:33
Shadow on scroll for list with a scrollbar
$scroll-shadow
background linear-gradient(white 30%, rgba(black, 0)),
linear-gradient(rgba(black, 0) 10px, white 70%) bottom,
radial-gradient(at top, rgba(black, 0.2), transparent 70%),
radial-gradient(at bottom, rgba(black, 0.2), transparent 70%) bottom
background-repeat no-repeat
background-size 100% 20px, 100% 20px, 100% 10px, 100% 10px
background-attachment local, local, scroll, scroll