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
# main() | |
snippet main | |
int | |
main(int argc, const char **argv) | |
{ | |
${1} | |
return 0; | |
} | |
snippet mainn | |
int |
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 | |
regexp=".*-([A-Z].*-[0-9]*)" | |
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
if [[ "$branch" =~ $regexp ]]; then | |
refs_id=${BASH_REMATCH[1]} | |
if [ "$2" = message ]; then | |
echo -ne "\n${refs_id}" >> "$1" | |
else | |
sed -i "1s/^$/\n\n${refs_id}/g" "$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
git svn clone svn://svn.debian.org/svn/pkg-erlang/erlang/trunk debian-erlang | |
cd debian-erlang; git checkout 72f44f02d383d2858ed7480db7e5bbb662ea48d4 | |
git clone git://github.com/erlang/otp.git | |
cd otp | |
git checkout OTP_R15B03 | |
rm -rvf lib/*/doc/{archive,standard}/ | |
ln -s ../debian-erlang/debian | |
./otp_build autoconf | |
dpkg-buildpackage -rfakeroot -uc -b |
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
static char * lt15_xpm[] = { | |
"15 15 4 1", | |
" c None", | |
". c #FFFF00", | |
"+ c #1AA302", | |
"@ c #FC0000", | |
"...............", | |
"...............", | |
"...............", | |
"...............", |
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
%% @doc Return pid of a process which opened a socket binded to a given port. | |
-spec get_pid(inet:port_number(), 'tcp' | 'udp' | 'sctp') -> pid() | undefined. | |
get_pid(Port, Proto) when is_integer(Port), is_atom(Proto) -> | |
Name = name(Proto), | |
InetPorts = [P || P <- erlang:ports(), | |
{name, Name} == erlang:port_info(P, name)], | |
try | |
lists:filter( | |
fun (P) -> |
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 and export all | |
snippet mod | |
-module(${1:`Filename('', 'my')`}). | |
-compile([export_all]). | |
start() -> | |
${2} | |
stop() -> |
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(recaptcha). | |
-export([verify/3]). | |
-define(PRIVATE_KEY, "YOU_RPRIVATE_KEY"). | |
-define(URL, "http://www.google.com/recaptcha/api/verify"). | |
%% @doc WARNING: 'inets' application should be started! | |
-spec verify(list(), list(), list()) -> ok | | |
{error, invalid_site_private_key | invalid_request_cookie | | |
incorrect_captcha_sol}. |
NewerOlder