A selection of JavaScript snippets for your quick perusal when you are dashing between billion-dollar ideas.
blah
# ApplicationController | |
before_filter :cors_preflight_check | |
after_filter :cors_set_access_control_headers | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' | |
headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token' | |
headers['Access-Control-Max-Age'] = "1728000" |
'use strict'; | |
// Generated on 2014-04-14 using generator-leaflet 0.0.14 | |
var gulp = require('gulp'); | |
var open = require('open'); | |
var wiredep = require('wiredep').stream; | |
// Load plugins | |
var $ = require('gulp-load-plugins')(); |
## Android | |
Active files: 471 | |
Active lines: 56,744 | |
Total commits: 822 | |
Note: Files matching MIME type image, binary has been ignored | |
+----------------+--------+---------+-------+--------------------+ | |
| name | loc | commits | files | distribution (%) | |
find . -iname "*.js" -exec bash -c 'mv "$0" "${0%\.js}.ts"' {} \; |
/** | |
* An AngularJS directive for Dropzone.js, http://www.dropzonejs.com/ | |
* | |
* Usage: | |
* | |
* <div ng-app="app" ng-controller="SomeCtrl"> | |
* <button dropzone="dropzoneConfig"> | |
* Drag and drop files here or click to upload | |
* </button> | |
* </div> |
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all | |
rm -rf .git/refs/original/ | |
git reflog expire --expire=now --all | |
git gc --prune=now | |
git gc --aggressive --prune=now | |
git push --all --force |
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; var DI= document.images; DIL=DI.length; function A(){for(i=0; i < DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5+"px"; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5+"px"}R++}tag=setInterval('A()',5 );document.onmousedown=function(){clearInterval(tag);for(i=0; i < DIL; i++){DI.style.position="static";}}; void(0) |
Here is one thing you can do. | |
Copy the image you want to multiply. (CtrlA and CtrlC) | |
Make a new 'Black' color layer and click 'add mask'. | |
alt-click the Mask icon, so that you can enter to mask edit mode. | |
Paste your 'multiply' images in the mask (b/w) , and then invert it. | |
You will have a black layer with your multiply material masked. | |
You can adjust opacity of that layer to find best looking image. (30~40%?) | |
If you save it as transparent PNG file, you are done. |