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
<?php | |
function zip($sourceDir, $targetZipFileName) | |
{ | |
$zip = new ZipArchive(); | |
$zip->open($targetZipFileName, ZipArchive::CREATE); | |
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sourceDir)); | |
foreach ($iterator as $key => $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
PS1='\u:\W \$ ' | |
export PATH=/opt/local/bin:$HOME/bin:$PATH | |
export EDITOR=vi | |
alias l='ls -lphG' | |
alias ll='l -A' | |
alias rm='rm -v' | |
alias ..='cd ..' | |
alias ...='cd ../..' |
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
{ | |
"color_scheme": "Packages/User/Monokai Soda.tmTheme", | |
"detect_indentation": false, | |
"ensure_newline_at_eof_on_save": false, | |
"fallback_encoding": "Cyrillic (Windows 1251)", | |
"font_size": 12, | |
"highlight_line": true, | |
"translate_tabs_to_spaces": true, | |
"trim_trailing_white_space_on_save": true, | |
"use_tab_stops": true, |
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
# search and replace in files | |
$ sed -i 's/old-word/new-word/g' *.txt | |
# зайти в каждую директорию и обновить ее до указанного бранча | |
$ for f in *; do hg up megaplan-release-101 --cwd $f; done | |
# Скопировать ssh ключ на сервер | |
function sshid() { cat ~/.ssh/id_rsa.pub | ssh $1 "cat - >> ~/.ssh/authorized_keys.test"; } |
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
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | |
# $Id: Portfile 89008 2012-01-17 08:28:10Z ryandesign@macports.org $ | |
PortSystem 1.0 | |
name php5 | |
conflicts php5-devel php52 | |
# Keep version of php5 in sync with bundled php5 extension ports. | |
# Increment revision of php5-eaccelerator when updating version of php5. | |
epoch 1 |
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
<?php | |
/** | |
* Нахождение кратчайшего пути между двумя произвольными вершинами в графе | |
* http://ru.wikipedia.org/wiki/Алгоритм_Дейкстры | |
*/ | |
class Dijkstra | |
{ | |
private $_graph = array(); | |
private $_nodes = array(); |
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 hem = new (require('hem')); | |
var less = require('less'); | |
var fs = require('fs'); | |
var argv = process.argv.slice(2); | |
hem.compilers.less = function(path) { | |
var content, result; | |
content = fs.readFileSync(path, 'utf8'); | |
result = ''; | |
less.render(content, function(err, css) { |
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 PULL = function() { | |
var content, | |
pullToRefresh, | |
refreshing, | |
contentStartY, | |
success, | |
start, | |
cancel, | |
startY, | |
track = false, |
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
class InputConnector @Inject() ( | |
nodeMap: NodeMap, | |
complexNeedRepo: ComplexNeedRepo, | |
articleGenerator: ArticleGenerator, | |
doerRepo: DoerRepo | |
) extends Actor with ActorLogging { | |
/** | |
* Forward messages from transport to destination actor | |
* @since 27.06.12 15:26 |
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
val deliveryTime = | |
if (meta.deliveryTimeFrom.nonEmpty) { | |
meta.deliveryTimeFrom.get // optimistic | |
} else { | |
val currentTime = Await.result(timeService ? GetTime, timeout.duration).asInstanceOf[Long] | |
currentTime + (3600 * 24 * 1000) // next day | |
} |
OlderNewer