Skip to content

Instantly share code, notes, and snippets.

View AndreiDuma's full-sized avatar

Andrei Duma AndreiDuma

View GitHub Profile
@AndreiDuma
AndreiDuma / pagecontroller.php
Created June 24, 2013 08:07
They behave differently!
public function index() {
return $this->render('main');
}
public function caca() {
return $this->render('main');
}
public function routesRename() {
$layer = new RouteBusinessLayer($this->api);
print_r($this->getParams()); // debug - I get _nothing_ here
$layer->rename($this->getParams());
return new JSONResponse(array(), Http::STATUS_NO_CONTENT);
}
@AndreiDuma
AndreiDuma / EditBookmarkDialog.cpp
Last active December 19, 2015 16:29
@Earthwings: A typical bookmarks kml file. What does the "isBookmark" Data field in ExtendedData do?
GeoDataPlacemark EditBookmarkDialog::bookmark() const
{
//Create a bookmark object
GeoDataPlacemark bookmark;
bookmark.setName( name() );
bookmark.setDescription( description() );
//allow for HTML in the description
bookmark.setDescriptionCDATA( true );
bookmark.setCoordinate( coordinates() );
if ( d->m_range ) {
body {
margin: 0;
}
#window {
width: 960px;
margin: 0 auto;
}
#header {
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document>
<visibility>1</visibility>
<Folder>
<name>Europe</name>
<visibility>1</visibility>
<Folder>
<name>Romania</name>
<visibility>1</visibility>
@AndreiDuma
AndreiDuma / subextract.sh
Created January 13, 2014 20:30
A little script to help with extracting subtitles from .mkv files.
#!/bin/sh
if ! command -v mkvmerge mkvextract >/dev/null 2>&1; then
echo >&2 "Tools mkvmerge & mkvextract are required. Install package mkvtoolnix."
exit 1
fi
filename=$1
if [ ! -f $filename ]; then
#ifndef LIB
#define LIB
typedef struct {
// int type;
int len;
char payload[1400];
} msg;
enum frm_type {
#include <stdio.h>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
int main(int argc, char *argv[]) {
if (argc != 3) {
fprintf(stderr, "usage: %s address resource\n", argv[0]);
return 1;
%% ----------------------------------------
%% ----------------------------------------
%% Atenție la antetele predicatelor și la prefixul parametrilor
%% p(+Arg1, -Arg2, ?Arg3)
%% * Arg1 va fi instanțiat atunci când se va încerca satisfacerea p/3
%% * Arg2 se va instanția odată cu satisfacerea p/3
%% * Arg3 va putea fi instanțiat sau nu atunci când se va satisface p/3:
%%
%% Interogați Prolog cu "checkXX." pentru a verifica rezolvarea exercițiului XX.
%% Pentru a vedea progresul general, trimiteți scopul "check_all".
   Am       G               F                    C
  watching waves trying to guess where they'll crash
      F       C            Dm         C
  in making plans we keep losing the path
    Am       G               F      C
  think we know what we're looking for
         F       C         Dm         C
  we're missing signs we shouldn't ignore