Skip to content

Instantly share code, notes, and snippets.

struct FileChooserDialog {
private:
struct FileCompare {
bool operator() (const Glib::RefPtr<Gio::File>& a, const Glib::RefPtr<Gio::File>& b) const {
std::clog << (a->equal(b) ? "equal" : "not equal") << std::endl;
return a->equal(b);
}
};
public:
@chebert
chebert / gist:a501fc6c67b4ae406eb4
Last active August 29, 2015 14:12
full-sound-test
(define-foreign-library alsa
(t (:default "libasound")))
(defcenum snd-pcm-stream-t
:snd_pcm_stream_playback
:snd_pcm_stream_capture)
(defcenum snd-pcm-state-t
:SND_PCM_STATE_OPEN
:SND_PCM_STATE_SETUP
@chebert
chebert / SendToTmux
Last active August 29, 2015 14:14
Send keys to another buffer in a tmux session. Pretty handy.
nmap <silent> <leader>s :set opfunc=SendToTmux<CR>g@
nmap <silent> <leader>ss :call SendLineToTmux()<CR>
vmap <silent> <leader>s :<C-U>call SendToTmux(visualmode(), 1)<CR>
function! SendLineToTmux()
let line = line('.')
let col = col('.')
" TODO: this assumes the leader is ','
:normal 0,s$""
#0 0xb7c9c1e9 in malloc_consolidate (av=0xb4c00010) at malloc.c:5169
#1 malloc_consolidate (av=0xb4c00010) at malloc.c:5089
#2 0xb7c9d20c in _int_malloc (av=0xb4c00010, bytes=2568) at malloc.c:4373
#3 0xb7ca082e in __libc_calloc (n=1, elem_size=2568) at malloc.c:4065
#4 0xb6dc2d6a in ?? () from /usr/lib/i386-linux-gnu/dri/r600_dri.so
#5 0xb6dfda3a in ?? () from /usr/lib/i386-linux-gnu/dri/r600_dri.so
#6 0xb6dd7b77 in ?? () from /usr/lib/i386-linux-gnu/dri/r600_dri.so
#7 0xb695ce5c in ?? () from /usr/lib/i386-linux-gnu/dri/libgallium.so
#8 0xb6b986b1 in _mesa_Clear () from /usr/lib/i386-linux-gnu/dri/libdricore.so
#9 0xb7f9a7b5 in ogl_clear (color=0xbffff2b0, d=<optimized out>) at /home/chebert/Documents/Projects/BubbleBlaster/allegro-install/allegro-5.0/src/opengl/ogl_draw.c:104
bool Create::Params::CreateProperties::Populate(const Value& value, CreateProperties* out) {
Value* contexts_value = NULL;
if (dict->GetWithoutPathExpansion("contexts", &contexts_value)) {
{
ListValue* list = NULL;
if (!contexts_value->GetAsList(&list))
return false;
for (ListValue::iterator it = list->begin(); it != list->end(); ++it) {
std::string enum_temp;
if (!(*it)->GetAsString(&enum_temp))
TEST(PerformanceMonitorDatabaseSetupTest,
ActiveIntervalRetrievalDuringActiveInterval) {
FilePath alternate_path;
file_util::CreateNewTempDirectory(FilePath::StringType(), &alternate_path);
TestingClock* clock = new TestingClock();
scoped_ptr<Database> db = Database::Create(alternate_path);
db->set_clock(scoped_ptr<Database::Clock>(clock));
db->AddStateValue("test", "test"); //1
base::Time start_time = clock->GetTime(); //2
if (it->Valid()) {
it->Prev();
// blah blah blah
} else if (some other checks maybe?) {
start_key = start_time_key_;
}
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <GL/glew.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <iostream>
@chebert
chebert / gist:6966302
Created October 13, 2013 19:18
table not receiving updates
var authenticationToken = "thisisasupercutelittletokenfortestingandsuch";
Realtime.Storage.create({
applicationKey: "jpj5BT",
authenticationToken: authenticationToken,
isSecure: true,
}, onSuccess, errorFunc);
function onSuccess(storageRef) {
storageRef.table('chat_messages').on('update', 'Lgq4I3Pzjjk7T3nX', console.error.bind(console), console.error.bind(console));
}
Available Fonts:
A-OTF Futo Min A101 Pr5 Bold
A-OTF Futo Min A101 Pro Bold
A-OTF Midashi Min MA31 Pr5 MA31
A-OTF Midashi Min MA31 Pro MA31
A-OTF Ryumin Std B-KO
A-OTF Ryumin Std B-KS
A-OTF Ryumin Std H-KO
A-OTF Ryumin Std H-KS
A-OTF Ryumin Std L-KO