Skip to content

Instantly share code, notes, and snippets.

View mxrguspxrt's full-sized avatar

Margus Pärt mxrguspxrt

View GitHub Profile
@mxrguspxrt
mxrguspxrt / ammado.rb
Last active December 16, 2017 15:32
Ammado API example for Ruby (& Rails)
# Code repository: https://github.com/mxrguspxrt/ammado
# GEM: https://rubygems.org/gems/ammado
# Documentation: http://www.rubydoc.info/gems/ammado/1.0.1
@mxrguspxrt
mxrguspxrt / Network.cpp
Created October 23, 2016 14:55 — forked from mkroman/Network.cpp
Uncrustify configuration inspired by Google's C++ styleguide.
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include <stdarg.h>
#include <stdio.h>
// Example program
#include <iostream>
#include <string>
using namespace std;
class Inimene {
class FormModel
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
def self.form_fields
@form_fields ||= []
end
@mxrguspxrt
mxrguspxrt / Preferences.sublime-settings
Last active December 21, 2015 15:13
Preferences.sublime-settings
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
{
"font_face": "Bitstream Vera Sans Mono",
"font_size": 12,
"trim_trailing_white_space_on_save": true,
"draw_white_space": "selection",
"font_options": [ "gray_antialias" ],
"tab_size": 2,
"translate_tabs_to_spaces": true
@mxrguspxrt
mxrguspxrt / java2-home6-test.java
Created November 29, 2012 22:20
java2-home6.java
import static org.junit.Assert.*;
import org.junit.*;
public class AnswerTest {
Answer.Graph g;
Answer.Vertex v1;
@mxrguspxrt
mxrguspxrt / java2-home5.java
Created November 19, 2012 19:30
java2-home5.java
import java.util.*;
public class Answer {
public String name;
public Answer firstChild;
public Answer nextSibling;
public static <T extends Object> void p(T s){
@mxrguspxrt
mxrguspxrt / java2-home4.java
Created November 9, 2012 09:34
java2-home4.java
import java.util.*;
import java.util.regex.*;
/** Quaternions. Basic operations. */
public class Quaternion {
public double realPart;
public double i;
public double j;
public double k;
@mxrguspxrt
mxrguspxrt / riistvara-selftest3.txt
Created November 8, 2012 08:04
riistvara-selftest3.txt
Küsimus 1
Õige
Hindamata
Flag question