Skip to content

Instantly share code, notes, and snippets.

View gnysek's full-sized avatar
💭
Kuwabara! Kuwabara!

gnysek gnysek

💭
Kuwabara! Kuwabara!
View GitHub Profile
//override image class in JS
(function () {
var OriginalImage = window.Image;
window.Image = function (width, height) {
console.log('New image');
return new OriginalImage(width, height);
}
}());
@gnysek
gnysek / gamepad_key.gml
Last active September 23, 2016 14:22
gamepad_key
//on game initialization, call it only once!
globalvar gamepad_key, __gp;
gamepad_key = -1;
__gp[15] = gp_face1;
__gp[14] = gp_face2;
__gp[13] = gp_face3;
__gp[12] = gp_face4;
__gp[11] = gp_shoulderl;
__gp[10] = gp_shoulderlb;
__gp[9] = gp_shoulderr;
@gnysek
gnysek / games.txt
Created October 31, 2016 10:32
Wymiana gier
PS4:
WatchDogs
Diablo 3
Divinity: Original Sin Enhanced Edition
Fallout 4
DiRT Rally
Final Fatansy X/X-2 Remastered
Mortal Kombat XL
Valkyria Chronicles Remastered
@gnysek
gnysek / gms2proposal.md
Last active November 8, 2016 15:22
GMS:2 bugs & proposals

GamemakerStudio 2 bugs and proposals

by Piotr 'gnysek' Gnys, GameMaker user from 2013

  • display sprite dimensions on sprite preview after F1 from script on workspace
  • display "X" in resource filter field on resource tree, to clear result fastly
  • display list of objects in which sprite is set as image/mask (same as parent/children for objects)
  • in sprite window, there's [-] [=] [+] buttons, but there's lack of [max] (extend to window size)
  • find/replace window for scripts/code
  • find/replace options from GM 1.x
@gnysek
gnysek / ds_map_secure_load_array.gml
Created November 18, 2016 15:58
ds_map_secure_load_array.gml
var d = ds_map_secure_load(argument0);
var n = ds_map_find_first(d);
while (!is_undefined(n)) {
var is_2d = false;
var size = 0;
@gnysek
gnysek / gms_tutorial.md
Created August 7, 2017 07:50
GMS wstęp

Read our installation guide

Wiedza którą powinno się posiadać przed rozpoczęciem pracy z programowaniem w GM Studio (subiektywnie):

  • dodawanie, odejmowanie, mnożenie, dzielenie (względnie potęgowanie i pierwiastkowanie)
  • ułamki dziesiętne (zaokrąglanie w dół, w górę)
  • czym są osie x i y
  • dodawanie i mnożenie binarne (OR i AND), negacja binarna (NOT) - świadomość, że liczby i wyniki funkcji dające > 0.5 uznawane są za prawdę (true), a pozostałe za fałsz (false)

Czym są zasoby (resources)

@gnysek
gnysek / fix.diff
Created November 16, 2017 08:37
Magento disabled Flash fix
js/lib/flex.js:425
----
return Flex.checkFlashPlayerVersion(major, minor, revision);
+++
try {
return Flex.checkFlashPlayerVersion(major, minor, revision);
} catch (e) {
console.log('This browser doesn\'t support Flash, or disables it by default.');
@gnysek
gnysek / adblock hidden.css
Created January 11, 2018 12:10
adblock hidden
::content #ad-slot2, ::content #block-views-advertisement-block_1, ::content .dfp-ad-hideempty, ::content .ad-zone-ajax, ::content .layout__top-ad, ::content #stickyAd, ::content .ad-ex-wide-container, ::content #desktop-atf_sidebar_sticky, ::content #sdbr_ad_cnt, ::content .artnet-ads-ad, ::content .widgetSponsors, ::content .c-advert-app, ::content a[href^="http://steel.starflavor.bid/"], ::content .ad-element, ::content #divSponsoredLinks, ::content .sidebar-adverts-header, ::content .anchoringTopAdDefault, ::content .sidebar-adverts, ::content .c-control--adchoice, ::content .admania_themead, ::content .in-content-ad--container, ::content #ra-taboola-bottom, ::content [id^="bunyad_ads_widget"], ::content [id*="ScriptRoot"], ::content [id*="MGWrap"], ::content [id*="MarketGid"], ::content .cg2-ad, ::content #preloaded-ad-frame, ::content #header-box-ads, ::content a[href*="://converti.se/click/"], ::content #advertisments, ::content [class$="-ads"], ::content #LinkArea\:gry, ::content #widget-shop, ::conte
@gnysek
gnysek / acejs_bbc
Created June 1, 2015 07:40
ACE js bbcode
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var MyNewHighlightRules = function() {
this.$rules = {
"start" : [
///draw_text_colour_outline(x, y, string, textColor1, textColor2, textAlpha, outlineColor1, outlineColor2, outlineAlpha, outlineThickness, outlineQuality, xscale, yscale, angle);
//By Blokatt - @blokatt, blokatt.net
var i;
for (i = 0; i < 360; i += 360 / argument10){
draw_text_transformed_color(argument0 + lengthdir_x(argument9, i), argument1 + lengthdir_y(argument9, i), string(argument2), argument11, argument12, argument13, argument6, argument6, argument7, argument7, argument8);
}
draw_text_transformed_color(argument0, argument1, string(argument2), argument11, argument12, argument13, argument3, argument3, argument4, argument4, argument5);