Skip to content

Instantly share code, notes, and snippets.

View lamalex's full-sized avatar

Alex Launi lamalex

View GitHub Profile
@lamalex
lamalex / 8kzenrecover.py
Created September 24, 2023 15:22 — forked from lkraav/8kzenrecover.py
8kzenrecover.py
#!/usr/bin/python
# Copyright 2007 by Tobia Conforto <tobia.conforto@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
@lamalex
lamalex / lib.rs
Created November 18, 2021 19:24
Call her `bec!` you say?
#[macro_export]
macro_rules! bec {
// `()` indicates that the macro takes no argument.
() => {
"
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxxxkkkkkkkkkkkkkkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkxxkkkkkooddkkkkkkkkkkxxlcdkkkkkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
@lamalex
lamalex / gist:5690235ab00f414fc6fdfadbce960929
Created October 16, 2020 22:44
Quick function to always print 4 decimal places
def print_precision_4(x: float):
print(f'{x:.4f}')
print_precision_4(123.12345678)
@lamalex
lamalex / main.rs
Last active July 5, 2020 18:34
The civil war was definitely about slavery.
use regex::Regex;
use std::{env, fs};
use std::collections::HashMap;
fn main() {
let args: Vec<String> = env::args().collect();
let filename = &args[1];
let contents = fs::read_to_string(filename)
.expect("Something went wrong reading the file");
let re = Regex::new(r"\b[a-zA-z]*").unwrap();
pub mod matrix {
use num_traits::Num;
pub struct Matrix<T> {
pub rows: usize,
pub cols: usize,
data: Vec<T>,
}
impl<T> Matrix<T>
where
var dataRows = data.$('tr', '#ctl00_PageContent_usageGridView').filter(function() {
return this.hasClass('gridRow') || this.hasClass('gridRowAlternating');
});
dataRows.each(function(i, elem) {
console.log(elem.html());
});
✓ font-awesome
tag: https://github.com/nate-strauser/meteor-font-awesome.git#v0.1.6
/usr/local/share/npm/lib/node_modules/meteorite/lib/sources/git.js:151
hrow "There was a problem checking out " + self.checkoutType + ": " + (self.co
^
There was a problem checking out tag: v0.1.6
takePicture: function() {
var options = {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: 1,
encodingType: 1
};
navigator.camera.getPicture(
function(imageData) {
navigator.notification.alert(imageData, null, "great news!", '\'Aight');
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0