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 / 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) {
@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;
#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 / 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);
###
# Downloads and parses https://lh.2xlibre.net/locales/ into a
# JSON file split into the following fields:
# - code: locale code, i.e. 'en_GB'
# - suffix: locale code suffix, i.e. 'latin' from 'be_BY'
# - name: locale name, i.e. 'English' from 'en_GB'
# - country: locale country 'title'lized, i.e. 'United Kingdom' from 'en_GB'
# Settings as on where to save the html file and locale file can be found below
###
# -*- coding: utf-8 -*-
from wox import Wox, WoxAPI
import webbrowser
class Main(Wox):
def query(self, query):
results = []
if query[0] == "!":
@lances101
lances101 / Metro Server - No subtitles.xaml
Created January 10, 2018 10:17
Metro server theme with no subtitles
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Base.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#ffffff"/>
<Setter Property="Foreground" Value="#000000" />
</Style>
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="Background" Value="#001e4e"></Setter>
@lances101
lances101 / hotline_uah_to_eur.js
Created February 4, 2018 20:32
Hotline.ua UAH to EUR
// ==UserScript==
// @name HotlineUA UAH to EUR
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Boromak
// @match http://hotline.ua/*
// @grant none
// ==/UserScript==
@lances101
lances101 / wox_uninstaller.bat
Last active February 9, 2018 22:59
Wox uninstaller bat tool
@echo off
echo === Wox uninstallation utility ===
echo Now running Squirrel uninstaller
%LOCALAPPDATA%\Wox\Update.exe --uninstall .
echo Deleting Wox application files
rmdir %LOCALAPPDATA%\Wox /S /Q
echo Deleting Wox configuration files
rmdir %APPDATA%\Wox /S /Q
@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.