Skip to content

Instantly share code, notes, and snippets.

Avatar

Dmitrii 'Mamut' Dimandt dmitriid

View GitHub Profile
View .js
return _react2['default'].createElement(
'div',
{ className: 'menu' },
_react2['default'].createElement(
'div',
{ className: 'venue-select ' },
_react2['default'].createElement(
'div',
{ className: 'venue-name' },
_react2['default'].createElement(
View banner_gen.erl
-export([
init/1
, content_types_provided/2
, provide_content/2
]).
-include_lib("webmachine_resource.hrl").
-include_lib("zotonic.hrl").
View draw_text.py
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------
# test stuff
from optparse import OptionParser
import Image, ImageFont, ImageDraw, sys, codecs
if __name__ == "__main__":
parser = OptionParser()
parser.add_option("-l", "--label")
View something.js
var soId = '';
var soNumber = '';
var toCartForm = new Array();
var rec;
var today = new Date();
today = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0);
var tommorow = new Date(today.getFullYear(), today.getMonth(), (today.getDate()+1), 0, 0, 0, 0);
View gist:2724806
convert(S) ->
convert(S, [], [], []).
convert([], Ip, Port, _) ->
{Ip, Port};
%% ща будет порт
convert([$:|T], Ip, _Port, _Acc) ->
convert([], Ip, list_to_integer(T), []);
%% ща будет следующая цыфра
convert([$.|T], Ip, Port, _Acc) ->
View gist:2781291
// Type C++ code here, or load an example.
#include <iostream>
int main(){
std::cout << "aa";
return 0;
}
@dmitriid
dmitriid / mo.erl
Created Jul 7, 2012
Parse out Mod, Func, Name from function type spec
View mo.erl
%% Consider
%% mod:func([A],{A,B},list(), any(), some_type({A,list(),B})) -> ok | error.
%%
%% Start from the beginning. Scan each character
%%
%% 1. Once we hit ":", we've got our module name, start looking for function
%% name.
%% 2. Once we hit "(", we've got our method name, start looking for arguments
%% 3. Arguments are a bit trickier
%% 3.1 If we encounter a "{", "[", "(" we don't care about anything
View plt_cache_server.erl
-module(plt_cache_server).
-behaviour(gen_server).
%%%
%%% Exports
%%%
%%
%% API
%%
@dmitriid
dmitriid / CHANGELOG
Created Jul 24, 2012
HINT changelog
View CHANGELOG
* VERSION 2012-07-24
1. New search infrastructure
2. Code cleanup
3. OTP-biftab based PLT generation
4. Dialyzed
5. Web output cleaned-up
* Previous version:
View blog-post.rb
aliases :bp, :blog_post
class BlogPost < Nanoc::CLI::Commands::CreateItem
def run
# Check arguments
if arguments.length != 1
raise Nanoc::Errors::GenericTrivial, "usage: #{command.usage}"
end
# Extract arguments and options