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
# Shouldn't they be colored somehow fancy? | |
colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple'] | |
#jQuery comes to the resque | |
containerWidth = $('#container2').width() | |
containsrHeight = $('#container2').height() | |
# Add polygons to a layer | |
addPolygon = (layer) -> | |
n = layer.getChildren().length + 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
window.publishPost = -> | |
userId = window.fbUserId | |
post = | |
caption: "Evil Twins Hunt" | |
message: "Found an app to check FB for presence of Evil | |
Twins from the Evil Parallel Universe. Be watchful, tovarisch! | |
( And yeah, I also learned how to access FB info and publish | |
feed items from code, which is cool. )" | |
link: "http://coffeequery.blogspot.com/2012/04/hunting-evil-twins.html" | |
FB.api "/me/feed", 'post', post |
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
OAuth = require('oauth').OAuth | |
_ = require 'underscore' | |
class LinkedInClient | |
@baseUrl: 'https://api.linkedin.com' | |
@requestTokenUrl: "#{@baseUrl}/uas/oauth/requestToken" | |
@accessTokenUrl: "#{@baseUrl}/uas/oauth/accessToken" | |
@authorizeUrl: "#{@baseUrl}/uas/oauth/authorize" | |
@profileFields: ['id', 'headline', 'first-name', 'last-name', 'public-profile-url', 'picture-url', 'educations', 'positions', 'email-address'] |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title> | |
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function () { | |
var extractToken = function(hash) { |
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
<div id="palette" style="width: 510px; height: 80px;"> | |
</div> | |
<script type="text/coffeescript"> | |
colors = ['#CCDDBB', '#99CC66', '#88AA66', '#AADDCC', '#66AAAA', '#559999', '#FFFFDD', '#FF9922', '#DD8822', '#AACCDD', '#5599CC', '#4477AA'] | |
next_square_html = (color) -> | |
""" | |
<div style="background: #{color}; | |
border: 1px solid grey; | |
height: 30px; |
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
#Using $j instead of just $ to be more specific | |
$j = jQuery | |
#Storing page elements to local variables | |
clickme = $j '#ani1_clickme' | |
restore = $j '#ani1_restore' | |
bar1 = $j '#ani1_bar1' | |
bar2 = $j '#ani1_bar2' | |
#Cool shortcut, instead of $j(document).ready(function(){ |
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
major, minor = `bison --version`.scan(/bison \(GNU Bison\) (\d+)\.(\d+)/)[0].map(&:to_i) | |
$?.exitstatus == 0 && ([major, minor] <=> [2,4]) >=0 |
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(ring_benchmark). | |
-export([new/2]). | |
new(N, M) -> | |
spawn(fun() -> spawn_ring(N, M) end). | |
spawn_ring(N, M) -> | |
io:format("First process: ~p~n", [self()]), | |
NextPid = spawn_rest(self(), N), |
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
%%% File : ahocorasik.erl | |
%%% Author : Fyodor Ustinov <ufm@ufm.su> | |
%%% Descrip.: Multiple search based on Aho-Corasick string matching algorithm | |
%%% | |
%%% License : GPL | |
%%% | |
%%% Usage: | |
%%% ahocorasik:match(["pat1", "pat2"], "pat1 pat2 pat1") | |
%%% or | |
%%% Tree = ahocorasick:tree(["pat1", "pat2"]) |
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
require 'bio' | |
reg= Bio::Registry.new | |
genbank = reg.get_database('genbank') | |
entry = genbank.get_by_id('AA2CG') | |
print entry | |
ff = Bio::FlatFile.new(Bio::GenBank, File.open("/home/etsvigun/devenv/biotech/seq/gbhtg86.seq", 'r')) |