Skip to content

Instantly share code, notes, and snippets.

View lances101's full-sized avatar

Borys Makogonyuk Vasylev lances101

  • Eindhoven, Netherlands
View GitHub Profile
@lances101
lances101 / LocationCalculator.java
Created June 3, 2016 17:57
A location calculator for Exploration 2016
public class LocationUtility {
public static boolean areColliding(Location lvalue, Location rvalue) {
return lvalue.getX() == rvalue.getX() && lvalue.getY() == rvalue.getY();
}
private static void applyDirection(Location loc, int modX, int modY, int sizeX, int sizeY){
Location newLoc = new Location();
if(loc.getX() + modX > sizeX)
newLoc.setX(1);
else if(loc.getX() + modX < 1)
newLoc.setX(sizeX);
@lances101
lances101 / gist:c3f65e60e0c1dbe7729f
Created February 8, 2016 01:17
Directions services for Gmaps
var directionsService = new google.maps.DirectionsService();
var renderOptions = { draggable: true };
var directionDisplay = new google.maps.DirectionsRenderer(renderOptions);
//set the directions display service to the map
directionDisplay.setMap(map);
//set the directions display panel
//panel is usually just and empty div.
//This is where the turn by turn directions appear.
#region Blur Handling
/*
Found on https://github.com/riverar/sample-win10-aeroglass
*/
private enum AccentState
{
ACCENT_DISABLED = 0,
ACCENT_ENABLE_GRADIENT = 1,
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
ACCENT_ENABLE_BLURBEHIND = 3,
@lances101
lances101 / Pink 2.0.xaml
Last active August 15, 2020 19:31
Pink Theme for Wox with drop shadow effect on all four sides
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Base.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#1f1d1f"/>
<Setter Property="Foreground" Value="#cc1081" />
@lances101
lances101 / gist:654a8792b017b018c97c
Created November 10, 2015 22:26
Wox Translation Plugin
// Decompiled with JetBrains decompiler
// Type: TranslateWox.Main
// Assembly: TranslateWox, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 0A51035E-8791-4FC6-8557-D3506E321CD1
// Assembly location: C:\Users\Boris\Documents\WoxTranslation\TranslateWox.dll
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
@lances101
lances101 / gist:b4e05ad849312077e413
Created May 5, 2015 19:47
Javascript CrossDomain Workaround
/*
* Just a simple javascript cross domain workaround.
* The typical <script> hack with a little bit of sugar
* Needs a unique value to identify the callback
* in the callback stack when the script completes.
* The uniqueId is not generated outside because it needs to be passed
* as a parameter in the API call
* The callback stack is stored in window.crossDomainCallbacks
*/
function crossDomainScript(url, uniqueId, callback) {