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
| ;(function () { | |
| 'use strict'; | |
| var mediaQuery_desktop = 'screen and (min-device-width: 1200px) and (-webkit-min-device-pixel-ratio: 1) and (min-resolution: 96dpi)'; | |
| var handleMatchMedia = function(md) { | |
| if (md.matches) { | |
| require('./desktop'); | |
| } else { | |
| require('./mobile'); | |
| } | |
| } |
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
| var gm = require('gm'); | |
| var canvasWidth = 248; | |
| var canvasHeight = 389; | |
| gm(__dirname + '/original.jpg').size(function(error, size) { | |
| if (error) { | |
| console.error(error); | |
| } else { | |
| // current image size |
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
| document.body.scrollTop = document.documentElement.scrollTop = 0; |
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
| Mediator = function() { | |
| var debug = function() { | |
| // console.log or air.trace as desired | |
| }; | |
| var components = {}; | |
| var broadcast = function(event, args, source) { | |
| if (!event) { |
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
| Hi aleemb, | |
| I have in the index.volt | |
| {{ assets.outputJs('footer') }} | |
| </body> | |
| </html> | |
| So in the self defined function I do the same as I actually do in the controllers: | |
| $this->assets->collection("footer")->addJs("js/bootstrap/bootstrap.js") |
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
| #!/bin/bash | |
| #-------[COMMON]-------- | |
| ARCH="robo.tar.gz" | |
| STAMP=`date +%Y-%m-%d` | |
| DUMP_DIR=/var/baсkups/$STAMP | |
| OUTDIR1=$DUMP_DIR/mongodb | |
| OUTDIR2=$DUMP_DIR/mysql | |
| #-------[EXEC]---------- | |
| MYSQLDUMP="$(which mysqldump)" | |
| CHMOD="$(which chmod)" |
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
| #!/usr/bin/env python | |
| import smtplib, os, platform | |
| from email.MIMEMultipart import MIMEMultipart | |
| from email.MIMEText import MIMEText | |
| server = smtplib.SMTP('smtp.сайт.ru', 25) | |
| sender = 'root@'+platform.node() | |
| to = 'мояпочта@сайт.ru' |
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
| (function () { | |
| var alternate = true; | |
| $('#id').click(function () { | |
| if (alternate) { | |
| function1(); | |
| } else { | |
| function2(); | |
| } | |
| alternate = !alternate; | |
| }); |
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
| window.History.Adapter.bind (window, 'statechange', function() { | |
| if (typeof History.Adapter.artificial != "undefined") {delete (History.Adapter.artificial); return} | |
| .... your code here ..... | |
| }) | |
| window.History.pushStateOriginal = window.History.pushState | |
| window.History.pushState = function (state, string, url) { | |
| window.History.Adapter.artificial = true | |
| window.History.pushStateOriginal (state, string, url) | |
| } |
NewerOlder