Skip to content

Instantly share code, notes, and snippets.

View ValentinFunk's full-sized avatar
👋

Valentin ValentinFunk

👋
  • InnoVint, Inc
  • Tarifa, Spain
View GitHub Profile
@ValentinFunk
ValentinFunk / no_selection.lua
Last active September 28, 2015 11:28
Put this into a new file in lua/autorun/no_model_selection.lua to disable sandbox player selection
AddCSLuaFile()
hook.Add( "InitPostEntity", "RemoveEditor", function( )
list.Set( "DesktopWindows", "PlayerEditor", {
title = "Player Model",
icon = "icon64/playermodel.png",
width = 250,
height = 50,
onewindow = true,
@ValentinFunk
ValentinFunk / provision-node-kubernetes-ubuntu
Last active April 15, 2016 17:13
Some instructions for adding a new node to the cluster using the ubuntu scripts
export nodes="root@<MASTER NODE> root@<NEW NODE>"
export role="ai i"
export NUM_NODES=${NUM_NODES:-2}
export SERVICE_CLUSTER_IP_RANGE=192.168.3.0/24
export FLANNEL_NET=172.16.0.0/16
./new-node.sh
<IN kubernetes/cluster/new-node.sh>
#!/bin/bash
@ValentinFunk
ValentinFunk / custom-router.js
Last active October 5, 2016 17:43
ui-router-custom.js
/*!
* State-based routing for AngularJS
* @version v1.0.0-beta.3
* @link https://ui-router.github.io
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("angular"));
else if(typeof define === 'function' && define.amd)
# Creates Structures TypeInfo / TypeInfoData
def initStructures():
strucId = GetStrucIdByName("TypeInfo")
if (strucId == BADADDR):
strucIdInfoData = AddStrucEx(-1, "TypeInfoData", 0)
AddStrucMember(strucIdInfoData, "m_name", -1, (FF_QWRD|FF_DATA|FF_0CHAR), ASCSTR_C, 8)
ApplyType(GetMemberId(strucIdInfoData, 0), ParseType("char*", 0))
strucId = AddStrucEx(-1, "TypeInfo", 0)
AddStrucMember(strucId, "m_infoData", -1, (FF_QWRD|FF_DATA|FF_0STRO), 0, 8)
@ValentinFunk
ValentinFunk / some.component.html
Created January 4, 2017 10:40
Angular 2 Waypoints using ng2-scrollspy
<div scrollSpy>
<div [waypoint]="i" *ngFor="let i of [1,2,3,4,5,6,7,8]">
{{ i }}
</div>
</div>

Hi,

thanks for the speedy response. The devtool setting is set to hidden-source-map. I've just skimmed the plugin's source code and it does not set any header. Does that mean that when uploading a sourcemap without a comment reference in the minified file i need to set a HTTP header when uploading?

I've tried reading the CLI's source for some information and it seems that a x-sourcemap header is set. (Unfortunately https://docs.sentry.io/api/releases/post-release-files/ does not provide any information on this). I'll make a pull request for the webpack plugin to include that header if this is the case.

What format should the header value have? E.g. I have a file index.bundle.js and index.bundle.js.map, do i set it to ~/index.bundle.js?

// ==UserScript==
// @name ɮuy shit faster
// @namespace http://tampermonkey.net/
// @version 0.1
// @description ๖ۣɮuy shit faster
// @author VALLUS
// @include http://agariohub.net/client/shop
// @grant none
// ==/UserScript==
@ValentinFunk
ValentinFunk / print.lua
Last active June 27, 2017 11:15
Example for Pointshop2.com Drops and Crates custom lua crate and function to print all item class names.
local str = LibK._(Pointshop2.GetRegisteredItems()):chain()
:map(function(item)
return { className = item.className, name = item:GetPrintName() }
end)
:sort(function(a, b)
if tonumber(a.className) and tonumber(b.className) then
return tonumber(a.className) < tonumber(b.className)
elseif tonumber(a) and not tonumber(b) then
return false
else
@ValentinFunk
ValentinFunk / random.lua
Last active June 28, 2017 11:48
Give a random item from category
local function GiveRandomItemFromCategory( ply, categoryName )
local factory = Pointshop2.ItemFromCategoryFactory:new()
factory.settings = {
["ManualSettings.CategoryName"] = categoryName,
["BasicSettings.WeightedRandom"] = true
}
local item = factory:CreateItem( true )
return ply:PS2_EasyAddItem( item.class.className )
end
@ValentinFunk
ValentinFunk / leaveSessionTracker.js
Last active July 3, 2017 18:39
Sends events to analytics in timeouts to improve session tracking
window.addEventListener('beforeunload',
function(){
ga('send', 'event', 'Website', 'Unload', {transport: 'beacon', nonInteraction:true});
}
);
var timeout = 1;
var startTime = new Date().getTime();
function startBeacon() {
var timeOnSite = (startTime - new Date().getTime()) / 1000;