Skip to content

Instantly share code, notes, and snippets.

James Kraus jameskraus

  • Charlotte, NC
Block or report user

Report or block jameskraus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jameskraus
jameskraus / flow-override.js
Created May 12, 2017
Override default flow definition
View flow-override.js
// @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;
View flow-hoc-type.js
// @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 / composer-update-with-test.sh
Last active Mar 10, 2017
Update Composer Dependencies and Run Tests After Each Dependency
View composer-update-with-test.sh
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
@jameskraus
jameskraus / ImportGroups.php
Created Feb 9, 2017
Modified Adldap2-Larvel Command
View ImportGroups.php
<?php
namespace App\Console\Commands;
use Adldap\Models\Entry;
use Adldap\Models\Group;
use Illuminate\Console\Command;
class ImportGroups extends Command
{
@jameskraus
jameskraus / Zoom.py
Created Feb 21, 2016
Zoom extension for Anki
View Zoom.py
# -*- mode: Python ; coding: utf-8 -*-
# Copyright © 2012–2013 Roland Sieker <ospalh@gmail.com>
# Based in part on code by Damien Elmes <anki@ichi2.net>
# 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
You can’t perform that action at this time.