Skip to content

Instantly share code, notes, and snippets.

View gist:10260748
local is_soil = minetest.get_item_group(nu, "soil")
if is_soil == 0 then
return
end
View gist:dad17df0ae8c224db78a
•The P2P is **ONLY **to share updates via your OWN NETWORK.
•Telemetry - this is nothing new, Microsoft has collected logs and crash data from their OSes and Software for years. Even Apple does it with OSX. But if you are that paranoid download NTLite and remove Asimov.
•Real-Time Protection is there for a reason, to protect people. You can turn it off for varying intervals but yes it turns back on automatically to keep you protected. If you install a 3rd Party Antivirus like Trend Micro, Avast, etc. Windows 10 automatically disables Windows Defender.
•Cortana is a Web-Based service. The volume of data needed to make it work properly would not fit on most computers. But if you are that paranoid you can turn Cortana and Web Search off. On the taskbar click on the Magnifier icon, then click the Sandwich Icon top left, then click settings and turn Cortana and Web Search off. Then right click an empty space on the taskbar, click search and then hidden.
•Content-Suggestions - Yes the ads are there, but you can
View init.lua.txt
-- Simple logging mod
local path = minetest.get_modpath("log").."/data/"
-- returns block coordinates containing [pos] node
local function convert_position(pos)
return {x = math.floor(pos.x / 16), y = math.floor(pos.y / 16), z = math.floor(pos.z / 16)}
end
local function filename(pos, short)
if short == true then
View init.lua
local grass_gen = function( minp, maxp )
if maxp.y < 40 then
for lx = minp.x, maxp.x do
for ly = minp.y, maxp.y do
for lz = minp.z, maxp.z do
local p = { x = lx, y = ly, z = lz }
local n = minetest.env:get_node( p )
if n.name == "air" then
minetest.env:place_node( p, { name = "default:dirt_with_grass" } )
end
View gist:3731863
local grass_gen = function( minp, maxp )
if maxp.y < 40 then
for lx = minp.x, maxp.x do
for ly = minp.y, maxp.y do
for lz = minp.z, maxp.z do
local p = { x = lx, y = ly, z = lz }
local n = minetest.env:get_node( p )
minetest.env:add_node( p, { name = "default:dirt_with_grass" } )
end
end
View init.lua
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed)
local num_chunks = math.floor(chunks_per_volume * volume)
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
View gist:3912475
#include <iostream>
using namespace std;
int goals_of_first_team;
int goals_of_second_team;
int points_of_ManC;
@Jordach
Jordach / gist:6935009
Last active Dec 25, 2015
If the number fits in an 8 bit byte, then prepend 0s to make full 8 bit bytes, numbers above 255 get new digits added (like normal binary)
View gist:6935009
function DecToBase(IN,BASE)
local B,K,OUT,D=BASE or 10,"0123456789ABCDEFGHIJKLMNOPQRSTUVW",""
while IN>0 do
IN,D=math.floor(IN/B),math.mod(IN,B)+1
OUT=string.sub(K,D,D)..OUT
end
if string.len(OUT) == 1 then
OUT = "0000000" .. OUT
elseif string.len(OUT) == 2 then
OUT = "000000" .. OUT
View Payroll crap.lua
--Global variables
Assumed_Hour = 7.50
Tax_Level = 0.2
-- Options
print ('Please select your options:')
print ('1: Get payroll record.')
print ('2: Calculate net pay.')
print ('3: Print paycheck.')
View areas.cpp
#include <iostream>
using namespace std;
int main()
{
int length, width, perimeter, area;
cout << "Length = ";
cin >> length;