Skip to content

Instantly share code, notes, and snippets.

@lorenzopolidori
lorenzopolidori / has3d.js
Last active December 4, 2020 10:52 — forked from webinista/has3d.js
Testing for CSS 3D Transforms Support
function has3d(){
if (!window.getComputedStyle) {
return false;
}
var el = document.createElement('p'),
has3d,
transforms = {
'webkitTransform':'-webkit-transform',
'OTransform':'-o-transform',
@moluapple
moluapple / gist:2719021
Created May 17, 2012 13:44
AI CS6 Application.executeMenuCommand(menuCommandString: string ) 方法参数列表
menuCommandString,UI MenuString zh_CN
-------------------------------------
new,新建
newFromTemplate,从模板新建
open,打开
saveacopy,存储副本
Adobe AI Save For Web,存储为 Web 所用格式(W)
Adobe AI Save Selected Slices,存储选中的切片
revert,恢复
AI Place,置入(L)
@jpoehls
jpoehls / gist:5521004
Created May 5, 2013 14:43
hasOwnProperty() example
function rightWay(obj) {
for (var key in obj) {
// Ignore properties that are inherited.
if (!obj.hasOwnProperty(key)) {
continue;
}
console.log(key);
}
}
@jkresner
jkresner / Procfile
Created April 13, 2013 09:05
Deploy brunch to heroku
web: ./node_modules/.bin/coffee app.coffee
@cubicleDowns
cubicleDowns / marqueeselection.js
Last active December 23, 2017 00:22
Drag and Drop Marquee Selection with THREE.js and WebGL.
function listeners () {
demo.jqContainer.mousedown(mouseDown);
demo.jqContainer.mouseup(mouseUp);
demo.jqContainer.mousemove(marqueeSelect);
$(document).mousemove(resetMarquee);
}
function resetMarquee () {
mouseup = true;
mousedown = false;
@aibrean
aibrean / map-scroll.js
Created February 11, 2015 20:55
Enable Google map zooming on click only (disable scrolling)
// Disable scroll zooming and bind back the click event
var onMapMouseleaveHandler = function (event) {
var that = $(this);
that.on('click', onMapClickHandler);
that.off('mouseleave', onMapMouseleaveHandler);
that.find('iframe').css("pointer-events", "none");
// pointer-events needs to be added as a style on the iframe
}
@turadg
turadg / poltergeist_screenshot_helper.rb
Last active December 15, 2015 20:59
Poltergeist screenshot helper for Rspec
# spec/support/poltergeist_screenshot_helper.rb
module PoltergeistScreenshotHelper
# FROM http://blog.jerodsanto.net/2012/12/capybara-and-poltergeist-snap/
def snap!(options={})
path = options.fetch :path, "~/.Trash"
file = options.fetch :file, "#{Time.now.to_i}.png"
full = options.fetch :full, true
path = File.expand_path path
@colinbdclark
colinbdclark / imperative-adhoc-additive-synthesis.js
Last active August 29, 2015 14:17
Imperative Ad-Hoc Additive Synthesis (Clarinet)
var fundamental = 440,
harmonics = [1, 3, 5, 7, 9, 13, 15], // Clarinets only have odd partials.
baseHarmonicDef = {
ugen: "flock.ugen.saw",
freq: 440,
mul: {
ugen: "flock.ugen.envGen",
envelope: {
type: "flock.envelope.adsr",
attack: 0.1,