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
import ( | |
"github.com/Laughs-In-Flowers/xrr" | |
) | |
func openFile(path string) (*os.File, error) { | |
p := filepath.Clean(path) | |
dir, name := filepath.Split(p) | |
var fp string |
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
package cosmic | |
import ( | |
"fmt" | |
"math" | |
"math/rand" | |
"time" | |
cr "github.com/Laughs-In-Flowers/ifriit/lib/art/color" | |
"github.com/Laughs-In-Flowers/ifriit/lib/art/image" |
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
package main | |
import ( | |
"image" | |
"image/color" | |
"math" | |
mr "math/rand" | |
"time" | |
m "github.com/go-gl/mathgl/mgl64" |
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 <cmath> | |
#include <stdio.h> | |
#include <iostream> | |
#include "table.h" | |
bool Cubic::operator==(const Cubic& o) const { | |
return (X == o.X && Y == o.Y && Z == o.Z); | |
} | |
Cubic Cubic::operator+(const Cubic& o) const { |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
"runtime" | |
"testing" |
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
""" | |
This gist provides several mixins to be used on any number of sqlachemy models | |
1. HasLogMixin, provides a list EntityLog items specific and attached to an instance of the class | |
2. IsActor or IsReceiver mixins that allow the class to be related to an EntityLog item | |
as an actor or receiver | |
The ideal goal is EntityLog items, relatable to specific instances, and queryable by actor/receiver | |
attachable to any number of items with mixins. |
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
require("awful") | |
default_search_modes = { | |
i = {prompt="IMDB", search="https://imdb.com/"}, | |
w = {prompt="Wikipedia", search="https://wikipedia.com/"}, | |
g = {prompt="Google", search="https://google.com/"}, | |
} | |
local function create_wbox() | |
wbox = awful.wibox({ position = "bottom", ontop = true, screen = mouse.screen }) |
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
def topbar_pack(current_user): | |
if current_user.get_id(): | |
nav_pack = nav_in_pack() | |
user_pack = user_in_pack() | |
else: | |
nav_pack = nav_out_pack() | |
user_pack = user_out_pack() | |
tp = get_template_attribute('macros/topbar.html', 'topbar') | |
return tp(nav_pack, user_pack, current_user) |
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
def app_info(app): | |
''' information about your flask application''' | |
import pprint | |
pp = pprint.PrettyPrinter(indent=4) | |
config_list = [] | |
for k, v in app.config.iteritems(): | |
config_list.append("{}: {}".format(k, v)) | |
pp.pprint(config_list) | |
map_list = [] | |
for i in app.url_map.iter_rules(): |
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
class InternalMacro(object): | |
Manipulates or creates a macro given a name, macro text, and type of content to fill(is_tuple, is_dict, is_list, is_file). | |
Set content_is to 'passthrough' and kwarg 'to_pass' to move "something else" through this (useful where you | |
need to mix "something else" with internal macros for this a use case of this class, e.g. internally collating varied | |
aggregations of macros dependent on varied states or permissions | |
def __init__(self, name = None, | |
text = None, |
NewerOlder