Skip to content

Instantly share code, notes, and snippets.

View justinas's full-sized avatar

Justinas Stankevičius justinas

View GitHub Profile
#include <iostream> // kas kas toks?
using namespace std; // Sexually Transmitted Diseases?!
int main() // kodėl?
{
cout << "Labas" << endl; // šita eilutė bent jau būna paaiškinama mokytojų
// Nors „cout“ ir nėra daugiausiai sakantis žodis...
return 0; // why? just to fuck with you.
}
print "Labas\n";
for (int i = 0; i < 4; i++) {
priekin(50);
kairen(90);
}
justinas@ubuntu[~] python
Python 2.7.3 (default, Sep 26 2012, 21:53:58)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> s = "sėdėkužukėdės"
>>> s == s[::-1]
False
>>> s
's\xc4\x97d\xc4\x97ku\xc5\xbeuk\xc4\x97d\xc4\x97s'
>>> s = u"sėdėkužukėdės"
@justinas
justinas / upk.md
Created November 26, 2012 18:08
Upkarmos gimtadienis

Metai

Upkarmai šiandien sukako vieneri. Galbūt dar kam bus įdomu perskaityti istoriją vėl iš naujo...

2011-ųjų lapkričio šeštą gavau iš @NePosas žinutę su Twitter žaidimo idėja.

from:    NePo
to:	     [email protected]  
subject: Zaidimas
@justinas
justinas / U1.cpp
Created March 5, 2013 18:45
Kazicko forumo 2013 užduočių sprendimai
// Justinas Stankevicius
// Alytaus Jotvingiu giminazija
// "Pirminiai skaiciai"
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
@justinas
justinas / 1____48-khz-works
Last active December 15, 2015 15:19
Raspberry Pi AAC problems
General
Unique ID : 173489362611579315568203243584267068831 (0x8284D5FA2D0083EE84B5A2043ADDA59F)
Complete name : [WhyNot] Robotics;Notes - 21 [D9DA6289].mkv
Format : Matroska
Format version : Version 2
File size : 381 MiB
Duration : 22mn 54s
Overall bit rate : 2 324 Kbps
Encoded date : UTC 2013-03-14 23:28:45
Writing application : mkvmerge v5.0.1 ('Es ist Sommer') built on Oct 9 2011 11:55:43
Python 3.3.1 (default, Apr 17 2013, 22:32:14)
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> č = 1
>>> русский = True
>>> 💩 = False
File "<stdin>", line 1
💩 = False
^
SyntaxError: invalid character in identifier
@justinas
justinas / 1_singlehost.go
Last active November 29, 2023 11:41
Go middleware samples for my blog post. http://justinas.org/writing-http-middleware-in-go/
package main
import (
"net/http"
)
type SingleHost struct {
handler http.Handler
allowedHost string
}
@justinas
justinas / htmlTemplateMock.go
Created August 17, 2014 20:17
An idea for Go template mocking/output recording
/*
Basically, while writing a web app in Go I felt that
templates were the most undertested part of it.
I have no checks whether a handler actually executes a template,
is it the right one, is the correct context passed, etc.
This kind of mock provides a way to make lots of these checks.
*/
type Executable interface{