Skip to content

Instantly share code, notes, and snippets.

View veh guns.lua
local disabled = {[425] = true, [520] = true, [476] = true, [464] = true, [430] = true}
addEventHandler("onPlayerVehicleEnter", root,
function(vehicle)
local enabled = not disabled[getElementModel(vehicle)]
toggleControl(source, 'vehicle_fire', enabled)
toggleControl(source, 'vehicle_secondary_fire', enabled)
end)
addEventHandler("onResourceStart", resourceRoot,
View customtype.hpp
#ifndef __CUSTOMTYPE_H
#define __CUSTOMTYPE_H
#include <cassert>
#include <map>
#include "SDK/ScriptInstance.h"
#include "SDK/ScriptArguments.h"
class CustomType : public SDK::ScriptInstance
{
@mabako
mabako / gist:b4e3558cf313bf8cca5b
Created Aug 23, 2014
mysql2 gem segmentation fault
View gist:b4e3558cf313bf8cca5b
gendef.exe libmysql.dll
dlltool -v --dllname libmysql.dll --def libmysql.def --output-lib libmysql.lib
@mabako
mabako / Events.nut
Created Sep 11, 2014
vehicle-events.nut
View Events.nut
class Events
{
/*
* Add all Events & Execute the relevant ones for the players currently in game
*/
function Initialize()
{
Event.Add(Package.Current(), "stop", OnStop);
Event.Add(Player, "enterVehicle", OnEnterVehicle);
View gist:47c503bbc75f06687fcd
virt-install --connect qemu:///system -n win -r 2048 --vcpus=2 --disk /path/win.img,device=disk,bus=virtio --os-type windows --os-variant win2k8 -w network=default,model=virtio --hvm --vnc --noautoconsole --import
View commits.html.slim
- title 'Commits'
- content_for(:head) do
= auto_discovery_link_tag :rss, commits_url(:rss), title: "Commits"
- grouped = @commits.group_by { |c| c[:date].to_date }
- grouped.each_pair do |date, commits|
section.section.swatch-white-red
.container.element-short-top
.row
.col-md-3.element-short-bottom
View gist:5fc7eac3a50fc8cf0680
func main() {
var url string = "http://www.fh-zwickau.de"
cs := make(chan Wortspeicher, 1337)
done := make(chan bool)
go KompletteWortanalyse(cs, done)
// Es sollte die gesamte Textanalyse für alle Seiten geschehen, bevor (cs) geschlossen wird, d.h. wie auch immer das umgesetzt wird.
go AnalyzeText(url, cs) // ... usw. für mehrere Textdateien
View gist:6be62805f95eb87de89a
private UILabel CreateLabel(string type, Vector2 location, string text)
{
var lblObject = new GameObject("NameOfTheMod/" + type, typeof(UILabel));
lblObject.transform.parent = panel.transform;
var label = lblObject.GetComponent<UILabel>();
label.absolutePosition = location;
label.textAlignment = UIHorizontalAlignment.Center;
label.verticalAlignment = UIVerticalAlignment.Middle;
@mabako
mabako / stats.php
Created May 12, 2010
Statistics for valhallaGaming repos
View stats.php
mabako: 553814 (44.65%) lines, 3549 (54.38%) files
Mount: 363479 (29.31%) lines, 1172 (17.96%) files
Fenix: 240925 (19.43%) lines, 1463 (22.42%) files
Chamberlain: 51597 (4.16%) lines, 298 (4.57%) files
herbjr: 13238 (1.07%) lines, 18 (0.28%) files
Cazomino05: 5826 (0.47%) lines, 0 (0%) files
Flobu: 4733 (0.38%) lines, 10 (0.15%) files
VGMTAServer: 1751 (0.14%) lines, 1 (0.02%) files
Mr.Hankey: 1709 (0.14%) lines, 0 (0%) files
Jumba: 1187 (0.1%) lines, 3 (0.05%) files
View maketime.lua
local function isYearALeapYear(year)
if not year then
year = getRealTime().year + 1900
end
if (year % 4 == 0 and year % 100 ~= 0) or year % 400 == 0 then
return true
else
return false
end
end