This is a collection of knowledge I have built up regarding browser powered drag and drop functionality
- timing: once as drag is starting
event.target: draggableElement
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>My Angular from Scratch</title> | |
| <style> | |
| .my-component { | |
| font-family: Arial, sans-serif; |
| $(function() { | |
| var bitbucket_project_name = 'YOUR BITBUCKET PROJECT_NAME LIKE coorasse/airesis'; | |
| var codeship_project_code = 'YOUR CODESHIPO PROJECT UUID CODE (look for it in the badge instructions page or general settings page)'; | |
| var regexp = new RegExp("^https://bitbucket.org/" + bitbucket_project_name + "/pull-request/","g"); | |
| if ((regexp).test(window.location.href)) { | |
| var branch = $('dd.unabridged a').first().html(); | |
| var url = 'https://codeship.com/projects/'+codeship_project_code+'/status?branch='+branch; | |
| var row = $('<div></div>') | |
| var column1 = $('<dt>Codeship</dt>'); |
| #!/bin/bash | |
| # | |
| # deliver-maildir -- safely deliver mail to a Maildir. | |
| # | |
| # For information on the Maildir convention, see | |
| # http://en.wikipedia.org/wiki/Maildir | |
| # | |
| # This program is offered subject to the BSD three-clause license, | |
| # see the bottom of this file for details. |
Today, I released the new version of MessagePack for Ruby!
I rewrote all the code and achieved significant performance improvement, especially for serialization. I compared the new version to the old version (v4) using ruby-serializers benchmark, and the new version is faster for all data sets including Twitter, Image, Integers, Geo and 3D model.
| #!/usr/bin/env ruby | |
| # A simple script to quickly set up Sublime Text 2 to use it in Gnome 3. | |
| # | |
| # It will: | |
| # * copy the official Sublime icons into your ~/.local/share/icons/hicolor/[...] | |
| # * make a symlink to sublime_text in your ~/bin/ | |
| # * create a sublime_text_2.desktop in ~/.local/share/applications/ | |
| # | |
| # Licence: WTFPL |
| #!/usr/bin/env ruby | |
| # script to delete one line from a file | |
| # because remembering how sed works is too hard | |
| # Tijn Schuurmans - May 4, 2012 | |
| def print_usage | |
| puts <<-end_usage_description | |
| delete_line |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE language SYSTEM "language.dtd"> | |
| <!-- | |
| Kate SCSS syntax highlighting definition | |
| Modified the Kate CSS syntax highlighting definition to support SCSS. | |
| This file should be merged with any updates to the normal Kate CCS definition (see note on version numbering in changelog for 1.2.03.0). | |
| The latest version of this file can be found at https://gist.github.com/958598 |