Skip to content

Instantly share code, notes, and snippets.

View A-gambit's full-sized avatar

Gregory Shekhet A-gambit

View GitHub Profile
@A-gambit
A-gambit / 1.py
Created September 14, 2015 22:30
from math import sqrt, pow
print_matrix = lambda matrix: reduce(lambda y, x: y + "\n" + " ".join(map(lambda z: str(z), x)), matrix, "")
print_vector = lambda vector: reduce(lambda y, x: y + "\n" + str(x), vector, "")
print_vector_inline = lambda vector: reduce(lambda y, x: y + str(x) + " ", vector, "")
copy_matrix = lambda m: map(lambda x: map(lambda y: y, x), m)
def read(filename):
matrix = []
package com.grisha.tree;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class Main {
public static Node createTmpTree() {
Node animal = new Node("Animal");
Node bear = new Node("Bear");
import Html exposing (Html, Attribute, text, toElement, div, input, button)
import Html.Attributes exposing (..)
import Html.Events exposing (on, targetValue, onClick)
import Signal exposing (Address)
import StartApp
import String
main =
StartApp.start { model = model, view = view, update = update }
import Text exposing (..)
import Color exposing (..)
import Graphics.Element exposing (..)
import Graphics.Collage exposing (..)
import Window
figure color size =
filled color (circle size)
import Text exposing (..)
import Color exposing (..)
import Graphics.Element exposing (..)
import Graphics.Collage exposing (..)
diamond: Color -> Float -> Form
diamond color size =
circle size |> filled color
main =
import React from 'react'
import {addons} from 'react/addons'
import getId from '../tools/get_id'
import htmlParser from '../tools/html_parser'
import checkText from '../tools/get_text'
import getFile from '../tools/get_file'
import cn from '../tools/class_name'
let LiveView = React.createClass({
function emitter(obj){
var store = {}
obj.on = function (e, cb) {
add(e, cb, true)
}
obj.one = function (e, cb) {
add(e, cb, false)
}
obj.off = function (e) {
delete store[e]
@A-gambit
A-gambit / 2.js
Last active August 29, 2015 14:24
function emitter(obj){
var store = {}
obj.on = function (e, cb) {
add(e, cb, true)
}
obj.one = function (e, cb) {
add(e, cb, false)
}
obj.off = function (e) {
delete store[e]
.git/
node_modules/
dist/
function loadFileCb(html) {
debugger
}
function downloadFile(url, callback) {
if (url) {
var accessToken = gapi.auth.getToken().access_token;
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.setRequestHeader('Authorization', 'Bearer ' + accessToken);