Skip to content

Instantly share code, notes, and snippets.

View mxrguspxrt's full-sized avatar

Margus Pärt mxrguspxrt

View GitHub Profile
@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 {
@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 / Preferences.sublime-settings
Last active December 21, 2015 15:13
Preferences.sublime-settings
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
@mxrguspxrt
mxrguspxrt / reio-on-omo.js
Created June 16, 2015 10:23
reio-on-omo.js
var App = {
Init: function (data) {
$("#devicetypes").change(App.DeviceTypeChanged);
$("#makes").change(App.MakeChanged);
$("#models").change(App.ModelChanged);
$(".conditions").change(App.ConditionChanged);
App.PopulateDefaulListValues(1, 13);
@mxrguspxrt
mxrguspxrt / Preferences.sublime-settings
Last active August 29, 2015 14:15
My Sublime settings
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by file type specific settings.
{
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"detect_indentation": false
}
.menu a {
display: block;
}
.form-control {
margin-bottom: 20px;
width: 100%;
}
.form-control .fa {
@mxrguspxrt
mxrguspxrt / controller.js
Last active August 29, 2015 14:07
Creating assocations
// you have to have assocations defined and in view you can check isDirty
// it is automatically pushed to your assocation (in our case order)
actions: {
addOrderProduct: function() {
var order = this.get("controllers.order.model");
var orderProduct = this.store.createRecord("orderProduct", {order: order});
return orderProduct;
}
}
@mxrguspxrt
mxrguspxrt / gist:4644d0397b89bb8d2ff1
Created October 4, 2014 16:27
Ember HashTransform for Grapho,
App.HashTransform = DS.Transform.extend({
deserialize: function(serialized) {
return serialized || {}
},
serialize: function(deserialized) {
return deserialized || {}
}
});
@mxrguspxrt
mxrguspxrt / yo-mvc.js
Last active August 29, 2015 14:02
just saving
var Yo = function(){}
Yo.Application = function(){
this.Router = null;
this.Controllers = {};
this.Views = {};
this.Repositories = {};
this.Models = {};
}