Skip to content

Instantly share code, notes, and snippets.

Avatar
🥚
Eating eggs from big endian

Gurkirat Singh tbhaxor

🥚
Eating eggs from big endian
View GitHub Profile
@JordanReiter
JordanReiter / split_by_language.py
Created May 9, 2019
Given a block with mixed languages, split into individual sections by language
View split_by_language.py
'''
requires langdetect, available on pypi (pip install langdetect)
https://github.com/Mimino666/langdetect
'''
import langdetect
def split_by_language(content, delimiter='\n', joiner='\n',
languages=None, fail_silently=True):
'''
@iyvinjose
iyvinjose / data_loading_utils.py
Last active Apr 18, 2022
Read large files line by line without loading entire file to memory. Supports files of GB size
View data_loading_utils.py
def read_lines_from_file_as_data_chunks(file_name, chunk_size, callback, return_whole_chunk=False):
"""
read file line by line regardless of its size
:param file_name: absolute path of file to read
:param chunk_size: size of data to be read at at time
:param callback: callback method, prototype ----> def callback(data, eof, file_name)
:return:
"""
def read_in_chunks(file_obj, chunk_size=5000):
@Ircama
Ircama / Digispark.md
Last active May 8, 2022
Configuring the Digispark ATtiny85 board for Arduino IDE and upgrading the bootloader
View Digispark.md

Configuring the Digispark ATTINY85 board for Arduino IDE and upgrading the bootloader

Warning: this document has to be updated by pointing to https://github.com/SpenceKonde/ATTinyCore

This note describes the configuration of an ATtiny85 based microcontroller development board named Digispark and similar to the Arduino line. It is available in many online marketplaces for roughly 1 dollar (e.g., Ebay, Amazon, AliExpress) and is shipped fully assembled, including a V-USB interface (a software-only implementation of a low-speed USB device for Atmel's AVR microcontrollers). Coding is similar to Arduino: it uses the familiar Arduino IDE and is already provided with a ready-to-use bootloader (

@loic-moriame
loic-moriame / index.js
Created Jul 24, 2015
node.js + sequelize + sqlite
View index.js
'use strict';
var Sequelize = require('sequelize');
var sequelize = new Sequelize('mainDB', null, null, {
dialect: "sqlite",
storage: './test.sqlite',
});
sequelize
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 19, 2022
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@roachhd
roachhd / README.md
Last active May 18, 2022
Basics of BrainFuck
View README.md

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION