import {View} from 'backbone';
export default class MyView extends View {
initialize() {
this.$el.css('color', 'red');
/* | |
UPDATE July 2016 , moved and updated to here: https://github.com/Sumbera/gLayers.Leaflet | |
Generic Canvas Overlay for leaflet, | |
Stanislav Sumbera, April , 2014 | |
- added userDrawFunc that is called when Canvas need to be redrawn | |
- added few useful params fro userDrawFunc callback | |
- fixed resize map bug | |
inspired & portions taken from : https://github.com/Leaflet/Leaflet.heat |
/** | |
* Copyright 2013 Facebook, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
//http://caniuse.com/#feat=calc | |
//union bool str (-webkit-calc, -moz-calc, calc) | |
//alternatively see last version where i did a version check based on can i use | |
document.addEvent("domready", function() {//based off https://gist.github.com/Rob-ot/3399053 | |
Browser.Features.calc = false;//union bool str (-webkit-calc, -moz-calc, calc) | |
["","-webkit-","-moz-","-o-"].some(function(prefix) { | |
var $el = new Element('div', { | |
styles: { | |
width: prefix + "calc(5px)" | |
} |
#include <stdio.h> | |
#include <windows.h> | |
#include <winsock2.h> | |
int pid = 0; | |
STARTUPINFO lpStartupInfo; | |
PROCESS_INFORMATION lpProcessInformation; | |
BOOL CALLBACK EnumChildWindowsProc(HWND hwnd, LPARAM lparam){ | |
DWORD p; |
Every time I start a new project, I want to pull in a log
function that allows the same functionality as the console.log
, including the full functionality of the Console API.
There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log
was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.
This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:
- The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,
@font-face { | |
font-family: 'EntypoRegular'; | |
src: url('font/entypo.eot'); | |
src: url('font/entypo.eot?#iefix') format('embedded-opentype'), | |
url('font/entypo.woff') format('woff'), | |
url('font/entypo.ttf') format('truetype'), | |
url('font/entypo.svg#EntypoRegular') format('svg'); | |
font-weight: normal; | |
font-style: normal; | |
} |
Ever had the need to create a branch in a repo on Github without wanting (or being able) to access a local repo?
With the aid of [the Github API][1] and any online request app this is a piece of cake!
Just follow these steps:
- Open an online request app (like apirequest.io, hurl.it pipedream.com, reqbin.com, or webhook.site)
- Find the revision you want to branch from. Either on Github itself or by doing a GET request from Hurl:
https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs/heads
- Copy the revision hash
- Do a POST request from Hurl to
https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs
with the following as the POST body :
/*Copyright(c)2012 relay.github.com http://opensource.org/licenses/MIT*/function Deferred(){this.callbacks=[]} Deferred.prototype={err:0,x:0,$:function(a){this.callbacks.push(a);2==this.x&&this._(this.o);return this},done:function(a){return this.$([a,0])},fail:function(a){return this.$([0,a])},always:function(a){return this.$([0,0,a])},then:function(a,c){return this.$([a,c])},reject:function(a){this.x||(this.err=1,this._(a));return this},resolve:function(a){this.x||this._(a);return this},_:function(a){this.x=1;for(var c=this.err,d=this.callbacks,b=d.shift(),e=a;b;)try{for(;b;){(b=b[2]||(c?b[1]:b[0]))&&(e= b(e||a));if(e instanceof Deferred){var f=this;e.always(function(b){f._(b||a);return b});return}b=d.shift()}}catch(g){c&&(b=d.shift()),this.err=c=1}this.o=e||a;this.x=2}};Deferred.when=function(a,c){if(!c)return a;for(var c=[].slice.call(arguments),a=new Deferred,d=c.length,b=d,e=[],f=function(c){return function(d){e[c]=d;--b||a.resolve(e)}},g=function(b){a.reject(b)};d--;)c[d].then(f(d),g);return a}; |