This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function love.conf(t) | |
t.window.width, t.window.height = 200, 60 | |
t.window.x, t.window.y = 10, 10 | |
t.window.borderless = true | |
t.window.title = "Pomodoro!" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Simple currying module | |
-- | |
-- With a bit of extra complexity, so that | |
-- currying several times gives only one | |
-- level of function indirection for up to | |
-- five parameters. | |
-- weak table to store a reference to the curried | |
-- function, with the parameters and original function | |
local _curried = setmetatable({}, { __mode = 'k' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Sparse = {} | |
local function new(dimension) | |
local sparse = {} | |
sparse._dimension = dimension | |
return setmetatable(sparse, Sparse) | |
end | |
function Sparse.__index(sparse, key) | |
if sparse._dimension == 1 then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PALETTE_SIZE 4 | |
uniform float time = 0; | |
// Good old wave effect | |
uniform vec2 amplitude = vec2(0 / 128., 8/128.); | |
uniform vec2 speed = vec2(1., 2.); | |
uniform vec2 frequency = vec2(1, 3); | |
uniform float sampling_factor = 0.5; | |
uniform vec3 palette[PALETTE_SIZE+1]; | |
uniform bool inverse = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local num_verts = 100000 | |
local vertices = {} | |
for i=1,num_verts do | |
vertices[i] = {0, 0, 0, 0, 255, 255, 255, 255} | |
end | |
local ffi = require('ffi') | |
ffi.cdef[[ | |
typedef struct { | |
float x, y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo mount -o remount,size=10G,noatime /tmp | |
echo "Done. Please use 'df -h' to make sure folder size is increased." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cinttypes> | |
extern "C" { | |
__declspec(dllexport) void array_to_mat2d_byte(unsigned char* data, unsigned char** mat, size_t w, size_t h) { | |
for (size_t i = 0; i < w; ++i) { | |
mat[i] = data + h * i; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pacman | |
====== | |
view logs: /var/log/pacman.log | |
update system | |
# pacman -Syu | |
list installed packages | |
# pacman -Q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class BezierCurveScript : MonoBehaviour { | |
public class BezierPath | |
{ | |
public List<Vector3> pathPoints; | |
private int segments; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function string.fromhex(str) | |
return (str:gsub('..', function (cc) | |
return string.char(tonumber(cc, 16)) | |
end)) | |
end | |
function string.tohex(str) | |
return (str:gsub('.', function (c) | |
return string.format('%02X', string.byte(c)) | |
end)) |
NewerOlder