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
#!/bin/bash | |
# Delete Archived Applications | |
rm -r ~/Library/Developer/Xcode/Archives/*/ | |
# Delete Devired Data | |
rm -r ~/Library/Developer/Xcode/DerivedData/*/ | |
# Delete Apple cached files | |
rm -r ~/Library/Developer/CoreSimulator/Caches/dyld/*/*/ |
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
FROM python:3.5.3-onbuild | |
VOLUME ["/usr/src/app/staticfiles"] | |
CMD ["gunicorn", "--access-logfile", "-", "--error-logfile", "-", "-b", "0.0.0.0:8000", "app.wsgi", "-w", "4", "--preload"] | |
EXPOSE 8000 |
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
server { | |
listen 80; | |
server_name MY.WEBSITE.TLD; | |
root /Users/ME/Sites/FOLDER; | |
client_header_buffer_size 16k; | |
large_client_header_buffers 16 16k; | |
# qsa | |
rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; |
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
# create stub, then run flask app in tornado on port 5000 (perhaps with supervisord config below http://supervisord.org/index.html) | |
#!/usr/bin/env python | |
from tornado.wsgi import WSGIContainer | |
from tornado.httpserver import HTTPServer | |
from tornado.ioloop import IOLoop | |
from myflaskapp import app | |
http_server = HTTPServer(WSGIContainer(app)) |
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
//function | |
jQuery.fn.loadComplete = function (fn) { | |
return this.each(function () { | |
if (this.complete || this.readyState == 'complete') { | |
fn.call(this); | |
} else { | |
$(this).load(fn); | |
} | |
}); | |
}; |
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
from datetime import * | |
import calendar | |
#вычисляем начальную дату (1 день текущего месяца) | |
_date_from = date(datetime.now().year,datetime.now().month,1) | |
#30 дней назад | |
_date_from = datetime.now() + timedelta(-30) | |
#вычисляем конечную дату (последний день текущего месяца) |
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
@ECHO OFF | |
set PATH=%PATH%;%cd%\hg | |
cmd.exe |
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 hg_test | |
msiexec /a tortoisehg-2.7.1-hg-2.5.2-x86.msi /qb TARGETDIR=%CD%\hg_test | |
mkdir hg | |
xcopy %cd%\hg_test\pfiles\tortoisehg\* %cd%\hg /s /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
import scala.io.Source | |
//import scala.xml.parsing.XhtmlParser | |
import scala.util.{Try,Success,Failure} | |
//TODO:finish it! | |
val html = Try(Source.fromURL("http://freelansim.ru/tasks","UTF-8").mkString) | |
//val x = XhtmlParser(Source.fromString(html)) | |
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
(def a ["dress" "clothes"]) | |
(map #((fn [x] {:uid 1 :name x}) %) a) | |
(def b (map #((fn [x] {:uid 1 :name x}) %) a)) | |
(doseq [x b] (println x)) | |
(doseq [x (map #((fn [x] {:uid 1 :name x}) %) a)] (println x)) | |
(doseq [x (map #((fn [x] {:uid 1 :name x}) %) ["dress" "clothes"])] (println x)) |
NewerOlder