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 / source.sh
Created November 28, 2017 09:24
Source a .env File while escaping stuff
sed -E -n 's/[^#]+/export &/ p' .env | while read line ; do echo $(printf %q "$line") | eval ; done
@ValentinFunk
ValentinFunk / unzip.js
Created November 29, 2017 19:05
Unzip a stream in Node.JS
import * as request from 'request';
import * as shx from 'shelljs';
import * as fs from 'fs';
import * as unzip from 'unzipper';
import * as through from 'through2';
import * as Vinyl from 'vinyl';
function downloadLatestArtifact(gitlabToken: string, tokenType: 'PRIVATE-TOKEN' | 'JOB-TOKEN') {
// Download and unzip
const files = [];
@ValentinFunk
ValentinFunk / sh_playermodel_list.lua
Created December 3, 2017 15:14
Playermodel Lua. Put this into garrysmod/lua/autorun/sh_playermodel_list.lua
AddCSLuaFile()
--[[
Follow this template to add playermodels to the picker and make the hands work.
You need to make sure that the playermodels are downloaded on the client as well (i.e. FastDL or Workshop Download).
This is the template:
player_manager.AddValidModel( "<name>", "<player model path>" )
player_manager.AddValidHands( "<name>", "models/weapons/c_arms_cstrike.mdl", 0, "10000000" )
]]--
@ValentinFunk
ValentinFunk / install.sh
Last active December 13, 2017 15:32
Install Minikube
# Setup minikube
mkdir ~/kube
cd ~/kube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl
export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
export MINIKUBE_HOME=$HOME
local function generateStattrakItemInfo( itemClass, itemChance )
local info = {
chance = itemChance * 0.1, -- 10% chance of original item = get stattrak item
itemOrInfo = {
isInfoTable = true,
item = itemClass,
getIcon = function()
local icon = vgui.Create("DCsgoItemIcon")
icon:SetItemClass(itemClass)
-- Force border to red
@ValentinFunk
ValentinFunk / Dockerfile
Created January 30, 2018 10:10
Dockerfile for firebase bug
FROM node:6.11-slim
RUN yarn global add firebase-tools
RUN mkdir app
WORKDIR /app
RUN mkdir functions
COPY functions/package.json functions/package.json
RUN cd functions && yarn
COPY . .
@ValentinFunk
ValentinFunk / cl_playermodel.lua
Last active January 30, 2018 23:25
Put this in Pointshop2/lua/ps2/modules/mu_integration/cl_playermodel.lua
hook.Add("PS2_GetPreviewModel", "ForMurder", function()
if GAMEMODE.Spectating then
return {
model = player_manager.TranslatePlayerModel("male03"),
bodygroups = "0",
skin = 0
}
end
end)
@ValentinFunk
ValentinFunk / user.service.ts
Created February 2, 2018 09:24
Firebase Universal Example
@Injectable()
export class UserService {
constructor(private db: AngularFireDatabase, private zone: NgZone) {}
getUser(id: string | number): Observable<User> {
const user$ = this.database.object('profiles/' + id);
this.universalBlockUntilFirst(user$);
return user$;
}
@ValentinFunk
ValentinFunk / sv_ps2_knifepoints.lua
Last active February 12, 2018 15:48
Give extra points on knife kill (Pointshop 2). Create the file below in garrysmod/lua/autorun
local ptsMap = {
["csgo_bayonet"] = 10,
others = 5
}
hook.Add( "PlayerDeath", "ExtraPointsForKnifeKill", function( victim, inflictor, attacker )
if not IsValid( inflictor ) or not IsValid( attacker ) or not attacker:IsPlayer( ) then
return
end
@ValentinFunk
ValentinFunk / Guide.md
Last active June 13, 2018 20:58
Bind to F6. Put in lua/autorun

Binding Pointshop 2 to a key other than F1-F3

Put this script into lua/autorun. You can change KEY_F6 to any other key, for a list of keys look here: List of Keys - Gmod Wiki