This file contains hidden or 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
--- making an example to push to webscript | |
local icon = "https://pbs.twimg.com/profile_images/378800000410745178/8704302b5009e71d66fbc8f52cefc0bc_400x400.png" | |
local link = "https://talks.slack.com/services/hooks/incoming-webhook?token=" | |
local token = "" | |
local fi = json.parse(request.form.payload) | |
local fo = { | |
user_email = fi.user.email, |
This file contains hidden or 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
#!/usr/bin/python | |
themes = "./themes/" | |
from os import listdir, chdir | |
from os.path import isfile, join | |
from random import randrange | |
from time import strftime | |
import sys |
This file contains hidden or 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
use std::path::Path; | |
use std::io::{File, BufferedReader}; | |
/// opens a path to read a file. | |
fn open(p: &str) -> BufferedReader<File> { | |
BufferedReader::new(match File::open(&Path::new(p)) { | |
Ok(f) => f, | |
Err(e) => panic!("file error: {}", e) | |
}) | |
} |
This file contains hidden or 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
-- example of Memoize function with color generation. Saves speed! | |
-- saves colors being used, and appends with new colors. | |
local results = {} | |
setmetatable(results, {__mode = "v"}) | |
function create_RGB(r,g,b) | |
-- defining key by the colors used | |
local key = string.format("%d-%d-%d", r,g,b) | |
local color = results[key] |
This file contains hidden or 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
--- checks if a value exist in a table. | |
-- @function exist | |
-- @param t a table to check. | |
-- @param w a value to look for. | |
function exist(t, w) | |
for _, v in ipairs(t) do | |
if v == w then | |
return true | |
end | |
end |
This file contains hidden or 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
#!/usr/bin/env lua | |
--- returns the ppi from the resolution and diagonical inches of the screen. | |
-- @func ppi | |
-- @param inch is the diagonal inches of screen. | |
-- @param width is the width of native resolution. | |
-- @param height is the height of native resolution. | |
function ppi(inch, width, height) | |
return math.sqrt(width^2 + height^2) / inch -- ppi = pixels/inch | |
end |
This file contains hidden or 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
#!/usr/bin/env lua | |
function shuffle(tab) | |
-- allocation of the random array | |
local random_tab = {} | |
for i=1,#tab do | |
table.insert(random_tab, nil) | |
end |
This file contains hidden or 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
#!/usr/bin/perl -w | |
use File::Copy; | |
use Cwd; | |
# a simple rename scheme for the files. | |
sub add0 { | |
move($_[0], "$_[1]$_[0]"); | |
} |
This file contains hidden or 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
#!/usr/bin/perl | |
# Stream set for vlc | |
use IO::Handle; | |
##### Phase1 | |
# Definitions for the stream | |
$path = "/data/Videos"; |
This file contains hidden or 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
#!/usr/bin/env python | |
import os,subprocess,shutil | |
def move(): | |
return input("Give me the directory of work.\n") | |
def build(): | |
if os.path.exists("./build"): | |
shutil.rmtree("./build") |