Skip to content

Instantly share code, notes, and snippets.

View jameskraus's full-sized avatar

James Kraus jameskraus

View GitHub Profile
@jameskraus
jameskraus / Zoom.py
Created February 21, 2016 01:31
Zoom extension for Anki
# -*- mode: Python ; coding: utf-8 -*-
# Copyright © 2012–2013 Roland Sieker <[email protected]>
# Based in part on code by Damien Elmes <[email protected]>
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
"""Add-on for Anki 2 to zoom in or out."""
from PyQt4.QtCore import Qt, SIGNAL
from PyQt4.QtGui import QAction, QKeySequence, QMenu
@jameskraus
jameskraus / ImportGroups.php
Created February 9, 2017 21:26
Modified Adldap2-Larvel Command
<?php
namespace App\Console\Commands;
use Adldap\Models\Entry;
use Adldap\Models\Group;
use Illuminate\Console\Command;
class ImportGroups extends Command
{
@jameskraus
jameskraus / composer-update-with-test.sh
Last active March 10, 2017 14:26
Update Composer Dependencies and Run Tests After Each Dependency
grep '".*": ".*"' composer.json |
sed -E 's/[ \t]+//' |
sed -E 's/"[^\/]+": ".*",?//' |
sed '/.*\\.*/d' | sed -E '/^\s*$/d' |
sed -E 's/: ".*",?//' | sed -E 's/"//g' |
awk '{ print "composer update " $1 " && yarn test || exit 255""\0" }' |
xargs -n 1 -0 bash -c
// @flow
import React from 'react'
import ReactDom from 'react-dom'
class InnerComponent extends React.Component<void, { myVal: number }, void>{
props: { myVal: number }
render = () =>
<div>
@jameskraus
jameskraus / flow-override.js
Created May 12, 2017 20:44
Override default flow definition
// @flow
declare class Date {
constructor(): void;
constructor(timestamp: number): void;
constructor(dateString: string): void;
constructor(year: number, month: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number): void;
getDate(): number;
getDay(): number;
getYear(): number;