Skip to content

Instantly share code, notes, and snippets.

View aljachimiak's full-sized avatar

Al Jachimiak aljachimiak

View GitHub Profile

Keybase proof

I hereby claim:

  • I am aljachimiak on github.
  • I am al_odd (https://keybase.io/al_odd) on keybase.
  • I have a public key ASDJDM4DtIN4QemRnmDJ0Rne_3chGYCauGY8fI31BT1GNAo

To claim this, I am signing this object:

@aljachimiak
aljachimiak / PosibleCropSolution.js
Created August 7, 2017 17:50
When cropping an image that is too small, you may need to scale up one or both of the dimensions first.
class Image {
height: return this.height;
width: return this.width;
}
function Crop (image, newHeight, newWidth) {
const heightTooSmall = image.height < newHeight;
const widthTooSmall = image.width < newWidth;
// only do this if one or both of the dimensions is too small
07-26 14:12:40.536 13788-13788/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.itprotv, PID: 13788
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang
@aljachimiak
aljachimiak / Greed_game_and_score_method.rb
Created April 24, 2015 12:42
Greed Dice Game solution
# Greed is a dice game where you roll up to five dice to accumulate
# points. The following "score" function will be used to calculate the
# score of a single roll of the dice.
#
# A greed roll is scored as follows:
#
# * A set of three ones is 1000 points
#
# * A set of three numbers (other than ones) is worth 100 times the
# number. (e.g. three fives is 500 points).
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">