Skip to content

Instantly share code, notes, and snippets.

View aggsol's full-sized avatar
Mehr Kuchen, mehr C++

aggsol

Mehr Kuchen, mehr C++
View GitHub Profile
// ChaiScript has its own simple object model and works well with object
// oriented C++
// There is no difference between a function and a method, it's just syntactic sugar
var s = "mystring".size() // returns 8
var s2 = size("mystring") // returns 8
// class syntax
@algorev
algorev / experimental.rb
Created May 19, 2017 15:30
The final code of an algorave session with Sonic Pi: the result is available here: http://www.newgrounds.com/audio/listen/745306
live_loop :dubstep do
use_synth :growl
play_pattern_timed [:c4, :f53, :c3], 1, amp: 2
end
live_loop :drums do
sample :loop_industrial
sample :misc_cineboom
sleep 0.9
end
@mricon
mricon / ff
Last active September 25, 2019 07:15
Convenient wrapper for firejail and firefox
#!/bin/bash
# ff: convenient wrapper for firejail and firefox
#
# You can mix and match most keywords. Anything that's not a keyword
# will become the name of the private profile.
#
# Examples:
# ff
# - use basic defaults (no private directory, system resolver)
# ff 1dns personal
@idan
idan / gist:3135754
Created July 18, 2012 11:50
A Sample Post

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

@voldyman
voldyman / CellRenderer-treeview.vala
Last active October 17, 2021 18:56
This file shows how to use a custom cell renderer in a Gtk Treeview to build complex layouts
class MyCellRenderer : Gtk.CellRenderer {
// icon property set by the tree column
public Gdk.Pixbuf icon { get; set; }
public string text { get; set; }
public int progress { get; set; }
public int Padding;
private Gtk.CellRendererPixbuf icon_renderer;
private Gtk.CellRendererText text_renderer;
@JMoerman
JMoerman / main.vala
Created April 29, 2017 10:10
port of https://blog.gtk.org/2017/04/23/drag-and-drop-in-lists/ with scrolling and more advanced drag and drop
using Gtk;
class DragListBox : ListBox {
private ListBoxRow? hover_row;
private ListBoxRow? drag_row;
private bool top = false;
private int hover_top;
private int hover_bottom;
private bool should_scroll = false;
private bool scrolling = false;
@SkyzohKey
SkyzohKey / SettingsListBox.vala
Last active February 4, 2023 04:12
A simple ListBox to display Settings in a proper way.
public class SettingsListBox: Gtk.Box {
public Gtk.Box scrolled_box;
public Gtk.ListBox listbox;
public SettingsListBox () {
this.set_orientation (Gtk.Orientation.HORIZONTAL);
Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow (null, null);
scroll.set_size_request (400, 1);
@crowbarsolutions
crowbarsolutions / CustomDataSourceRequestAttribute.cs
Last active April 12, 2023 09:16
Have Kendo or Telerik grid date time filters to ignore or not account for the time in the underlying data
using System.Web.Mvc;
using MyProject.ModelBinders;
using Kendo.Mvc.UI;
namespace MyProject.CustomAttributes
{
public class CustomDataSourceRequestAttribute : DataSourceRequestAttribute
{
public override IModelBinder GetBinder()
{
@eliasdaler
eliasdaler / simple_meta_info_class.cpp
Created September 26, 2017 09:31
Simple meta info class for this article: https://eliasdaler.github.io/meta-stuff
#include <iostream>
#include <memory>
#include <string>
#include <unordered_map>
#include <json.hpp>
using json = nlohmann::json;
template <typename Class>
@jwinder
jwinder / sonic-pi-tutorial.md
Last active September 22, 2023 20:12
Sonic Pi in-app tutorials concatenated - last synced 27-08-2023 - https://sonic-pi.net/tutorial.html - https://github.com/samaaron/sonic-pi - All credit & thanks to Sam Aaron!

1 Welcome to Sonic Pi

Welcome friend :-)

Welcome to Sonic Pi. Hopefully you're as excited to get started making your own sounds as I am to show you. It's going to be a really fun ride where you'll learn all about music, synthesis, programming, composition, performance and more.