Skip to content

Instantly share code, notes, and snippets.

View yvan-sraka's full-sized avatar

Yvan Sraka yvan-sraka

View GitHub Profile
@yvan-sraka
yvan-sraka / wzip.py
Created February 20, 2023 09:46 — forked from ryancdotorg/wzip.py
Partial/streaming zip downloader
#!/usr/bin/env python3
# SPDX-License-Identifier: 0BSD or CC0-1.0 or MIT-0 or Unlicense
# Copyright (c) 2023, Ryan Castellucci, No Rights Reserved
import io, sys
import datetime
import argparse
import requests
import operator
import struct
@yvan-sraka
yvan-sraka / rusty-monoid.rs
Created February 16, 2023 21:30 — forked from snoyberg/rusty-monoid.rs
Rusty Monoid
#![feature(try_trait_v2)]
use std::ops::Try;
trait Monoid: Default {
fn mappend(self, rhs: Self) -> Self;
}
impl Monoid for i32 {
fn mappend(self, rhs: Self) -> Self {
self + rhs
@yvan-sraka
yvan-sraka / parallax_tgas.ipynb
Created March 25, 2018 19:58 — forked from eteq/parallax_GaiaDR2.ipynb
An demonstration of parallax using stars near the sun from the Gaia mission, astropy, astroquery, and matplotlib.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yvan-sraka
yvan-sraka / rtrt.js
Created February 20, 2018 10:55 — forked from jwagner/rtrt.js
var abs = Math.abs;
var sqrt = Math.sqrt;
var floor = Math.floor;
var min = Math.min;
var V3 = function(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
}
@yvan-sraka
yvan-sraka / gist:f3f8bba130c8deada37cc922e8ab0a51
Created May 7, 2017 09:39 — forked from andphe/gist:3232343
Export your links from Safari reading list
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'
@yvan-sraka
yvan-sraka / pocketdedupe.py
Created May 6, 2017 14:20 — forked from Mierdin/pocketdedupe.py
A Python script to intelligently remove duplicate entries from Pocket
#!/usr/bin/env python
from pocket import Pocket
import webbrowser, sys
# Get consumer key from cmd line
consumer_key = sys.argv[1]
request_token = Pocket.get_request_token(
consumer_key=consumer_key,
#include "stdio.h"
//stop
void stop()
{
throw 42;
}
//operation