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
path = "" | |
sel = 1 | |
function init() | |
term.clear() | |
term.setCursorPos(1,1) | |
dir = fs.list("") | |
for a, i in ipairs(dir) do | |
if a == 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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func partialSum(c chan<- float64, kStart int, kOffset int, amount int) { | |
// Using the Bailey–Borwein–Plouffe formula | |
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 Permutation: | |
def __init__(self, perm_list): | |
self.perm_list = perm_list | |
self.n = len(perm_list) | |
def __repr__(self): | |
return ( | |
' '.join([str(i) for i in range(1, self.n + 1)]) + | |
'\n' + | |
' '.join([str(i) for i in self.perm_list]) |
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
let last_index = 0; // TODO: check if last_index is in range of videos.length | |
sections.forEach(section => { | |
section.data.forEach(item => { | |
item['video'] = last_index; | |
last_index++; | |
}); | |
}); |
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
// Based on Ben Eater's tutorial | |
#define SHIFT_DATA 2 | |
#define SHIFT_CLOCK 3 | |
#define SHIFT_LATCH 4 | |
#define EEPROM_I0 5 | |
#define EEPROM_I7 12 | |
#define WE 13 | |
void set_address(int addr, bool OE) |
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
<div class="ui one column centered grid"> | |
<h1 class="row">text</h1> | |
</div> | |
<div class="ui divider"></div> |
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 role_required(role=ROLE_USER): | |
def wrapper(f): | |
@wraps(f) | |
def role_checker(*args, **kwargs): | |
if not current_user.is_authenticated: | |
abort(403) | |
if role == ROLE_USER or current_user.role == role: | |
return f(*args, **kwargs) | |
else: |
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 matplotlib.pyplot as plt | |
def get_input(): | |
print('X label?') | |
xlabel = input() | |
print('Y label?') | |
ylabel = input() |
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
{% macro print_errors(field) -%} | |
{% for err in field.errors %} | |
<span style="color: red;">[{{ err }}]</span> | |
{% endfor %} | |
{%- endmacro %} |
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 <cstdlib> | |
#include <cstring> | |
#include <fstream> | |
#include <iostream> | |
#include <stdexcept> | |
#include <vector> | |
#include "lodepng/lodepng.h" // you have to have lodepng in this folder to compile | |
bool open_input(std::string filename, std::vector<unsigned char> &img, unsigned int &width, |
NewerOlder