This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'fileutils' | |
| # Set folder path | |
| folder_path = "/User/absolute/path/to/dir" | |
| # Start at number | |
| start = 0 | |
| # Group into directories of size | |
| size = 125 | |
| # "%07d" for 7 digits ie 0000001.jpg | |
| padding = "%07d" | |
| # Then run this monster |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyApp.Update | |
| constructor: (@obj, @attrs={}) -> | |
| @obj.data ?= {} | |
| @obj.isOwned = false | |
| $.extend @attrs, | |
| ownerId: (v) => | |
| @obj.isOwned = MyApp.account.signedIn v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Router.query = (function(router) { | |
| var current = function () { | |
| return router.current(); | |
| }; | |
| var rawParams = function () { | |
| return current().params.query; | |
| }; | |
| var params = function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // `domains` is a global containing valid domains grouped by keys | |
| // this module is instantiated via require at the top of some file and | |
| // the following is run once per request: | |
| // Origin.foundKey(blah, blah); | |
| // some origin stuff | |
| var _ = require('underscore'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //// | |
| ......................................................... | |
| ..............T........................................................ | |
| ............................T..................T.................................... | |
| .T....................T.......................................T.................................. | |
| .....................T.....T...................T.........................................T........ | |
| ............................................ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //// | |
| .......... | |
| ..................... | |
| ..T.......T....T...........T... | |
| .......................................... | |
| ...........T........................................ | |
| .....T................T...............T........................ | |
| .........T...................... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| router.post('/:id/title-image', (req, res, next) => { | |
| lwip.open(req.file.buffer, 'jpg', (err, image) => { | |
| if (err) { next(err); return; } | |
| let ratio = (image.width() > 960 ? (960 / image.width()) : 1); | |
| image.scale(ratio, (err, image) => { | |
| if (err) { next(err); return; } | |
| image.crop(image.width(), Math.min((image.width() / 2), image.height()), (err, image) => { | |
| if (err) { next(err); return; } | |
| image.toBuffer('jpg', { quality: 80 }, (err, buffer) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0000000000000000000000000111111111111111100000000000000000000000000000000000000000000000000000000000 | |
| 0000000000000000000111111111111111111111111111111110000000000000000000000000000000000000000000000000 | |
| 0000000000000111111111111111111111111111111111111111111111111100000000000000000000000000000000000000 | |
| 0000000111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000 | |
| 0000011111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000 | |
| 0000011111111111111111111111111111111111122222222222222221111111111111111111111111111110000000000000 | |
| 0000011111111111111111111111111222222222222222233333333333333333331111111111111111111111000000000000 | |
| 0000111111111111111111222222222222222223333333333333333333333333333333333333311111111111000000000000 | |
| 0000111111111111122222222222222333333333333333333333333333333333333333333333333333111111100000000000 | |
| 0000111111111111122222333333333333333333333333333333333333333333333333333333333333311111100000000000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "env": { | |
| "node": true, | |
| "es6": true | |
| }, | |
| "extends": "eslint:recommended", | |
| "parserOptions": { | |
| "sourceType": "module", | |
| "ecmaVersion": 8 | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // My custom shader for implementing dithered alpha | |
| shader_type spatial; | |
| render_mode blend_mix,depth_draw_opaque,cull_disabled,diffuse_burley,specular_schlick_ggx; | |
| // Texture maps | |
| uniform sampler2D texture_albedo : hint_albedo; | |
| uniform sampler2D texture_masks : hint_white; | |
| uniform sampler2D texture_normal : hint_normal; | |
| // Parameters |
OlderNewer