Skip to content

Instantly share code, notes, and snippets.

function queryDone(queryResult) {
    $.each(queryResult, function(i, Line){
        $("<li>").addClass("StopName").text(Line.StopName).appendTo("#stops");
        var ul = $("<ul>");
        ul.appendTo("#stops");
        $.each(Line.Table, function(i, arrival){
arrivalListItem = $("<li>");
$("<span>").addClass("LineName").text(arrival.LineName).appendTo(arrivalListItem);
            $("<span>").addClass("ArrivalTime").text(arrival.ExpectedTime).appendTo(arrivalListItem);
arrivalListItem.appendTo(ul);
@jjgod
jjgod / rt.py
Last active August 29, 2015 14:06
from urllib2 import Request, urlopen, URLError
from bottle import route, run
import math
import json
import sys
import utm
import urllib
import datetime
import dateutil.parser
diff --git a/content/browser/download/base_file_posix.cc b/content/browser/download/base_file_posix.cc
index 4cf987c..7dd88a8 100644
--- a/content/browser/download/base_file_posix.cc
+++ b/content/browser/download/base_file_posix.cc
@@ -21,6 +21,7 @@ DownloadInterruptReason BaseFile::MoveFileAndAdjustPermissions(
int write_error = base::WriteFile(new_path, "", 0);
if (write_error < 0)
return LogSystemError("WriteFile", errno);
+ usleep(100);
}
From 9b95e1237d6f4bba8fa1a5f9e16e439ef3c902d2 Mon Sep 17 00:00:00 2001
From: Jiang Jiang <jiangj@opera.com>
Date: Wed, 15 Oct 2014 15:54:58 +0200
Subject: [PATCH] Breakpad: Support passing direct callback for in process
handling
---
.../src/client/apple/Framework/BreakpadDefines.h | 1 +
breakpad/src/client/mac/Framework/Breakpad.h | 16 ++++++++++++++++
breakpad/src/client/mac/Framework/Breakpad.mm | 21 ++++++++++++++++++++-
@jjgod
jjgod / systemfont.m
Created November 23, 2014 20:34
Shape text with system font.
// systemfont.m
#import <Cocoa/Cocoa.h>
int main(int argc, char const *argv[]) {
NSFont* font = [NSFont menuFontOfSize:18.0];
CTFontRef ctFont = (CTFontRef)font;
CFStringRef str = CFSTR("Opera");
From 96a780135d15645ae56bbfc09599cb0ddc9aea73 Mon Sep 17 00:00:00 2001
From: Jiang Jiang <gzjjgod@gmail.com>
Date: Mon, 1 Dec 2014 23:31:55 +0100
Subject: [PATCH] Fix Apple Color Emoji support for OS X 10.7+
BUG=chromium:62435
---
.../Source/platform/fonts/mac/FontCacheMac.mm | 4 --
third_party/skia/src/ports/SkFontHost_mac.cpp | 58 +++++++++++++---------
2 files changed, 34 insertions(+), 28 deletions(-)
From 0ae9d7914b44353fdc90c8dff0ef174e91d9f475 Mon Sep 17 00:00:00 2001
From: Jiang Jiang <jiangj@opera.com>
Date: Wed, 3 Dec 2014 16:43:47 +0100
Subject: [PATCH] DNA-30730: Backport WebKit patch to fix input button paddings
It's a backport of the following patch by zalan@apple.com:
Subpixel Layout: Align <input type="button", submit> etc (PushButtonPart) top and bottom paddings with <button>
https://bugs.webkit.org/show_bug.cgi?id=127640
Document focused element was set to nullptr on detach, but client
wasn't informed so it still believes that the current focused url
to be the one that no longer exists. It's a bit of a mystery how
this code every worked though.
BUG=425584
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 4427c73..d4a4bac 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc
index 689b936..292e9bf 100644
--- a/ui/gl/gl_context_cgl.cc
+++ b/ui/gl/gl_context_cgl.cc
@@ -120,17 +120,23 @@ bool GLContextCGL::Initialize(GLSurface* compatible_surface,
return true;
}
+void ReleaseCGLPixelFormat(CGLPixelFormatObj fmt) {
+ LOG(INFO) << "CGLReleasePixelFormat: " << CGLGetPixelFormatRetainCount(fmt);
@jjgod
jjgod / config
Last active August 29, 2015 14:14
My ~/.mpv/config
hwdec=auto
sub-text-font="Hiragino Sans GB:style=Bold"
sub-text-font-size=60
sub-auto=fuzzy
sub-codepage=utf-8:gb18030
no-sub-ass
save-position-on-quit