Skip to content

Instantly share code, notes, and snippets.

@NIA
NIA / temp.rb
Created September 21, 2010 15:31
def temp
:cool!
end
tool инструмент, орудие
direct at/aim at/shoot at/head at направлять на
particular особенный, частный
dramatic волнующий, яркий
ignite воспламенять, зажигать
thermonuclear fusion термоядерный синтез (~)
simple/mundane простой, земной
intense сильный, интенсивный
emit излучать, испускать
equal to that of (какое-то свойство) равное тому же у (чего-то) (~)
@NIA
NIA / translate.html
Created October 31, 2010 18:39
Подфигачил пример по Google Translate API для перевода на русский
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
</head>
<body>
<form name="f" id="f" action="#" onsubmit="translate(); return false;"><textarea name="text" rows="4" cols="60">Enter text here</textarea><br /><br /><input type="submit" value="Перевести на русский" onfocus="this.blur();" /><br /><br /><textarea name="translation" rows="4" cols="60" onfocus="this.select();" readonly="true"></textarea></form><br /><script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript">google.load("language", "1"); function translate() {var originaltext=document.forms["f"].text.value; google.language.translate(originaltext, "", "ru", function(result) { document.forms["f"].translation.value = (result.error)?("Error: "+result.error.message):result.translation; }); } </script>
</body>
</html>
@NIA
NIA / morality-2010-11-12.txt
Created November 11, 2010 16:37
Слова из трёх текстов про мораль (Slotin, Text A, Text B)
incident/accident/case случай
distinguished выдающийся, знаменитый
faith вера
conduct поведение
ascent восхождение, подъём
bright яркий, блестящий, умный
daring дерзкий
be concerned with/deal with заниматься, интересоваться
sustain поддерживать (горение, реакцию)
explosive взрывчатка
@NIA
NIA / gist:801810
Created January 29, 2011 13:05
parsing JSON data to Calendar
private static final String dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"; // 2011-01-29T00:02:08+06:00
public static Calendar parseDate(String strDate) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat, Locale.US);
Calendar cal = Calendar.getInstance();
cal.setTime(sdf.parse(strDate));
return cal;
}
@NIA
NIA / gist:801844
Created January 29, 2011 13:49
parse JSON double to Double (null allowed), catching optional NumberFormatException
public static Double parseDouble(String string) throws ParseException {
if("null".equals(string)) {
return null;
}
try {
return Double.parseDouble(string);
} catch (NumberFormatException e) {
throw new ParseException("Unparseable double: " + string, 0);
}
3 + 2 + 1 + 2 + 3 +
1 + 3 + 4 + 2 + 1 +
2 + 4 + 1 + 4 + 2 +
1 + 2 + 4 + 3 + 1 +
3 + 2 + 1 + 2 + 3
@NIA
NIA / run.sh
Created February 27, 2011 05:34 — forked from cypok/run.sh
#!/bin/sh
git submodule add git://github.com/tpope/vim-rails.git bundle/rails
git submodule add git://github.com/msanders/snipmate.vim.git bundle/snipmate
git submodule add git://github.com/vim-scripts/bufexplorer.zip bundle/bufexplorer
git submodule add git://github.com/scrooloose/nerdcommenter.git bundle/nerdcommenter
git submodule add git://github.com/scrooloose/nerdtree.git bundle/nerdtree
git submodule add git://github.com/tpope/vim-surround.git bundle/surround
git submodule add git://github.com/tpope/vim-cucumber.git bundle/cucumber
git submodule add git://github.com/tpope/vim-haml.git bundle/haml
let $PATH .= ';E:\Program Files\Git\bin\'
runtime vimrc
% вставка картинки: \figure{file}{описание}
\newcommand{\includefigure}[2]{
\begin{figure}[!htb]
\center{\includegraphics{#1}}
\caption{#2} \label{fig:#1}
\end{figure}
}