Skip to content

Instantly share code, notes, and snippets.

View webus's full-sized avatar
:octocat:
in progress

webus webus

:octocat:
in progress
View GitHub Profile
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;
from datetime import *
import calendar
#вычисляем начальную дату (1 день текущего месяца)
_date_from = date(datetime.now().year,datetime.now().month,1)
#30 дней назад
_date_from = datetime.now() + timedelta(-30)
#вычисляем конечную дату (последний день текущего месяца)
@webus
webus / 02_enjoy.bat
Last active December 15, 2015 12:39
@ECHO OFF
set PATH=%PATH%;%cd%\hg
cmd.exe
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
@webus
webus / test_scala2.10_future.scala
Created January 18, 2013 14:27
test new futures in Scala 2.10
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))
@webus
webus / vector2map.clj
Created November 17, 2012 05:59
experience with doseq
(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))
@webus
webus / play_cntrl.sh
Created June 25, 2011 23:25
play_cntrl bash script
#!/bin/bash
set +v
clear
PLAY_VERSION=$1
PLAY_DIR="/usr/local/share/play"
PLAY_EXT_PATH=$PLAY_DIR/play-$PLAY_VERSION
main() {
echo "check for availability in the system..."
if [ ! -d $PLAY_DIR/$PLAY_VERSION ]; then
@webus
webus / update_play.sh
Created March 16, 2011 21:30
Only update Play! and Scala,GAE,Siena plugins and rebuild
#!/bin/sh
m_path=$PWD
cd play
git pull
cd modules/scala
git pull
cd ../gae
git pull
cd ../siena
git pull
@webus
webus / play_plugins_compile.sh
Created March 16, 2011 21:23
Compile Play! with Scala,GAE,Siena plugins
#!/bin/sh
m_path=$PWD
rm -RIf play
git clone https://github.com/playframework/play.git
cd play/framework
ant
cd ../modules
git clone https://github.com/guillaumebort/play-scala.git
git clone https://github.com/guillaumebort/play-gae.git
git clone https://github.com/vijaykiran/play-siena.git