Skip to content

Instantly share code, notes, and snippets.

@earnubs
earnubs / snappy-osx-vmware-fusion-howto.md
Last active August 13, 2018 21:09
How to setup Ubuntu Core 16 for developers on OS X with VMWare Fusion

Creating an Ubuntu Core Series 16 image

On VMWare fusion, running an Ubuntu Xenial VM, which has a copy of your OS X public SSH key -- the script to build the image will add it to the generated image -- grab the script at https://github.com/zyga/devtools/blob/master/ubuntu-image to create a new image:

./ubuntu-image.sh --developer-mode pc

Convert .img to .vmdk

qemu-img convert pc-devel.img -O vmdk snappy.vmdk

@obiwankennedy
obiwankennedy / qmlhighlighter.cpp
Last active September 26, 2018 16:03
QSyntaxHighlight for QML
/***************************************************************************
* Copyright (C) 2014 by Renaud Guezennec *
* http://www.rolisteam.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@eddie-chinbat
eddie-chinbat / twitterstreaming.cpp
Last active October 18, 2019 00:43
Twitter streaming API example on c++
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <oauth.h>
#include <curl/curl.h>
#include <ncurses.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/property_tree/ptree.hpp>
@malekpour
malekpour / Startup.cs
Last active May 30, 2020 17:44
Iris Go vs .NET Core Kestrel in terms of HTTP performance
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Http;
@etenzy
etenzy / mvc.md
Last active May 17, 2021 18:52
MVC View Model Naming Conventions
  • Model: Singular
  • View: Plural
  • Controller:
    • Plural: If your controller contains at least one action method that handles multiple entities at a single transaction. (resourceful)
    • Singular: example the AccountController is singular because it represents actions (action method) pertaining to a single account only.
  • Route: Plural
@komasaru
komasaru / TwitterStream.cpp
Created November 24, 2014 03:11
C++ source code to get twitter timelines by Twitter Streaming API.
/*
* Getting timelines by Twitter Streaming API
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <oauth.h>
#include <curl/curl.h>
@justincase
justincase / gist:5469009
Created April 26, 2013 17:45
Print struct with field names and values. From http://blog.golang.org/2011/09/laws-of-reflection.html
type T struct {
A int
B string
}
t := T{23, "skidoo"}
s := reflect.ValueOf(&t).Elem()
typeOfT := s.Type()
for i := 0; i < s.NumField(); i++ {
@vitan
vitan / PriorityQueue_Multiple_producers_consumers.go
Last active January 23, 2022 08:51
PriorityQueue in golang, to support multiple producers and multiple consumers. with example how to use it
package main
import (
"errors"
"fmt"
"math"
"reflect"
"sync"
)
@thure
thure / 1.1: Why state machines?.md
Last active February 6, 2023 14:56
SCXML Tutorials

Fundamentals: why state machines?

States. The final frontier. These are the voyages of an enterprising developer. Her eternal mission: to explore strange new techniques, to seek out better ways to engineer for mental models and new design patterns. To boldly go where a few awesome devs have gone before.

So you’ve found our poignant guide to SCXML and surely you’re wondering “Why should I want to go out of my way to use formal state machines?” or something like that. Hopefully this introduction addresses that kind of question.

An example: Nancy’s RPG

The problem

@severin-lemaignan
severin-lemaignan / AnimatedArrow.qml
Last active March 12, 2023 08:29
A example showing how to animate an arrow along an arbitrary path using qml
import QtQuick 2.0
Item {
id: arrow
property var origin: null
property var end: null
property int duration: 2000
property color color: "red"