This file contains 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
module['exports'] = function echoHttp (hook) { | |
hook.debug("Debug messages are sent to the debug console"); | |
hook.debug(hook.params); | |
hook.debug(hook.req.path); | |
hook.debug(hook.req.method); | |
This file contains 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 modRewrite = require('connect-modrewrite'); | |
//... | |
// initConfig -> Connect section | |
livereload: { | |
options: { | |
open: true, | |
base: [ | |
'.tmp', |
This file contains 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
angular.module("app").directive("onRepeatFinish", ["$timeout", function($timeout){ | |
return { | |
restrict: "A", | |
link: function($scope, $element, $attrs) { | |
if ($scope.$last) { | |
$timeout(function(){ | |
if (angular.isFunction($scope[$attrs["onRepeatFinish"]])) | |
$scope[$attrs["onRepeatFinish"]]() | |
}); | |
} |
This file contains 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
mkdir output | |
i=1 | |
for f in *.jpg *.JPG | |
do | |
echo "$f -> photo-$i.jpg" | |
cp "$f" photo-$i.jpg | |
gm mogrify -resize 1920x1920 photo-$i.jpg | |
jpegtran -outfile output/photo-$i.jpg -copy none -optimize -perfect photo-$i.jpg | |
rm photo-$i.jpg | |
(( i++ )) |
This file contains 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
#include <windows.h> | |
#include "drv_mgr.h" | |
SC_HANDLE install_driver(const wchar_t *name, const wchar_t *path) | |
{ | |
SC_HANDLE h_scm; | |
SC_HANDLE h_svc = INVALID_HANDLE_VALUE; | |
if (!path || !name) | |
return INVALID_HANDLE_VALUE; |
This file contains 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
@mixin linear-gradient($from, $to) { | |
background: $from; | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, $from), color-stop(1, $to)); | |
background: -webkit-linear-gradient(top, $from, $to); | |
background: -moz-linear-gradient(top, $from, $to); | |
background: -ms-linear-gradient(top, $from, $to); | |
background: -o-linear-gradient(top, $from, $to); | |
background: linear-gradient(top, bottom, $from, $to); | |
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}'); | |
-ms-filter: quote(progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}')); |
This file contains 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
LOCAL_PORT = 3333 | |
REMOTE_PORT = 2222 | |
SSH_USER_HOST = "[email protected]" | |
express = require "express" | |
{spawn} = require "child_process" | |
ssh = spawn('ssh', ['-N', '-R', "#{REMOTE_PORT}:localhost:#{LOCAL_PORT}", SSH_USER_HOST]) | |
app = express() |
This file contains 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
dpkg --get-selections | |
dpkg -L <pkg-name> |
This file contains 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
String::translit = (-> | |
L = | |
"А": "A", "а": "a", "Б": "B", "б": "b", "В": "V", "в": "v" | |
"Г": "G", "г": "g", "Д": "D", "д": "d", "Е": "E", "е": "e" | |
"Ё": "Yo", "ё": "yo", "Ж": "Zh", "ж": "zh", "З": "Z", "з": "z" | |
"И": "I", "и": "i", "Й": "Y", "й": "y", "К": "K", "к": "k" | |
"Л": "L", "л": "l", "М": "M", "м": "m", "Н": "N", "н": "n" | |
"О": "O", "о": "o", "П": "P", "п": "p", "Р": "R", "р": "r" | |
"С": "S", "с": "s", "Т": "T", "т": "t", "У": "U", "у": "u" | |
"Ф": "F", "ф": "f", "Х": "H", "х": "h", "Ц": "Ts", "ц": "ts" |
This file contains 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
{ | |
"working_dir": "${project_path}", | |
"path": "C:\\Program Files\\nodejs;C:\\Users\\<USER_NAME>\\AppData\\Roaming\\npm", | |
"cmd": ["grunt", "--no-color"], | |
"shell": true | |
} |
NewerOlder