Skip to content

Instantly share code, notes, and snippets.

View andreinechaev's full-sized avatar
🐢
💨 💨 💨

Andrei Nechaev andreinechaev

🐢
💨 💨 💨
View GitHub Profile
package com.javarush.test.level03.lesson06.task03;
/* Семь цветов радуги
Выведи на экран текст: семь цветов радуги.
В каждой строке должно быть по три цвета, в последней - один.
Цвета разделяй пробелом.
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
#include <stdio.h>
static const int SIZE = 1000000;
int rank(int key, int arr[]);
int main(int argc, char *argv[]) {
int array[SIZE];
//
// main.c
// my_linked_list
//
// Created by Andrei Nechaev on 3/4/15.
// Copyright (c) 2015 Andrei Nechaev. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
// ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <pxcsensemanager.h>
#include <util_render.h>
int _tmain(int argc, _TCHAR* argv[])
{
// create the PXCSenseManager
//: Playground - noun: a place where people can play
import UIKit
let days = [1, 2, 3, 4, 5, 6, 7]
for day in days {
switch day {
case 1...5:
println("Weekday")
@andreinechaev
andreinechaev / main.py
Created February 12, 2016 17:28
Image resizing on S3
import boto3
import botocore.exceptions
from PIL import Image
s3 = boto3.resource('s3')
bucket = s3.Bucket('ajs3')
size = 200, 200
def resize(filename):
img = Image.open(filename)
package main
import "net/http"
func main() {
changeHeaderThenServe := func(h http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
h.ServeHTTP(w, r)
}
}
http.Handle("/", changeHeaderThenServe(http.FileServer(http.Dir("."))))
http.ListenAndServe(":8000", nil)
package main
import "net/http"
func main() {
changeHeaderThenServe := func(h http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
h.ServeHTTP(w, r)
}
}
http.Handle("/", changeHeaderThenServe(http.FileServer(http.Dir("."))))
http.ListenAndServe(":8000", nil)
package main
import (
"net/http"
"text/template"
"log"
"fmt"
)
type Page struct {
@andreinechaev
andreinechaev / main.go
Last active February 28, 2016 05:39
1.5 => 1.6
package main
import (
"io/ioutil"
"os"
"log"
"strings"
"sync"
)