Skip to content

Instantly share code, notes, and snippets.

View jalcine's full-sized avatar
💭
Decentralize and democratize the Web.

Jacky Alciné jalcine

💭
Decentralize and democratize the Web.
View GitHub Profile
@jalcine
jalcine / helper_commands.vim
Created April 30, 2014 18:33
Random commands for LYFE.
" Reformats JSON in current buffer nicely.
:%!python -m json.tool
@jalcine
jalcine / mother.js
Created May 4, 2014 03:31
Loading shit.
$('a[data-uri]').each(function(elem){
var $a = $(elem), theUrl = $a.attr('data-uri');
$('section#mother').load(theUrl);
});

Subway Info

##Preview

Screenshot 1: https://raw.github.com/parthibanloganathan/dashing_widgets/master/public/mta1.png Screenshot 2: https://raw.github.com/parthibanloganathan/dashing_widgets/master/public/mta2.png

Description

Subway Info is a Dashing widget which displays information on trains in New York City. Information includes train line, direction, station and arrival time. You can customize it to include any combination of lines and stations. This may also be used in other cities as well if you have the appropriate GTFS files.

Architectural Questions

  • Are responsibilities well defined?
  • Are the collaborations well defined?
  • Is coupling minimized?
  • Can you identify potential duplication?
  • Are interface definitions and constraints acceptable?
  • Can modules access needed data—when needed?
<?php
/** The '<?=' is the same as '<?php echo'. A shortcut. */
$record_text = __('Viewing {0} - {1} of {2}');
$invoices_url = url_for('account_billing/getInvoices') . '?year=';
$vat_entries = <<<VAT_INFO
{name:'invoice_amount', index:'invoice_amount', width:150, sortable:false, resizable:false, align:'right'},
{name:'vat_amount', index:'vat_amount', width:150, sortable:false, resizable:false, align:'right'},
VAT_INFO;
@jalcine
jalcine / pain_point.cpp
Created August 31, 2014 02:59
Pain Point in Wintermute
// Snatched from http://git.io/P3hFYw
PluginPrivate::~PluginPrivate()
{
if (libraryPtr->isLoaded())
{
wwarn("Unloading plugin " + name + "'s library...");
if (libraryPtr->unload())
{
wwarn("Unloaded library for plugin " + name + "!");
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
#include "learnuv.h"
#define BUF_SIZE 37
static const char *filename = __MAGIC_FILE__;
int main() {
int r = 0;
uv_loop_t *loop = uv_default_loop();
/* 1. Open file */
#include <uv.h>
#include <stdlib.h>
// Thanks learnuv.
#define CHECK(r, msg) if (r) { \
sprintf("%s: [%s(%d): %s]\n", msg, uv_err_name((r)), (int) r, uv_strerror((r))); \
exit(1); \
}
@jalcine
jalcine / foo
Created January 11, 2015 20:00
(gdb) run
Starting program: /home/jalcine/Development/Scratch/a.out
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGABRT, Aborted.
0x00007ffff7828e37 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt