Skip to content

Instantly share code, notes, and snippets.

View zodman's full-sized avatar
🤗
Code wins arguments!

Andres Vargas zodman

🤗
Code wins arguments!
View GitHub Profile
@francoism90
francoism90 / retrieve.py
Last active April 12, 2024 21:16
libtorrent - get seeds/peers + metadata without downloading (DHT/magnet)
#!/usr/bin/env python3
import libtorrent as lt
import time
import json
import os
def write_json(path, contents):
with open(path, 'w', encoding='utf-8') as f:
json.dump(contents, f, default=str, indent=4, sort_keys=True)
@niw
niw / fetch_nike_puls_all_activities.bash
Last active April 10, 2024 08:48
A simple NikePlus API description to fetch past run metrics
#!/usr/bin/env bash
# fetch_nike_puls_all_activities.bash
# A simple bash script to fetch all activities and metrics from NikePlus.
# See `nike_plus_api.md` for the API details.
readonly bearer_token="$1"
if [[ -z "$bearer_token" ]]; then
echo "Usage: $0 bearer_token"
exit
@NicolasLoew
NicolasLoew / index.php
Created June 24, 2017 06:26 — forked from null-dev/index.php
1fichier.com direct link generator (PHP)
<?php
if(!isset($_GET['a'])) {
die('<form action="" method="get"><input type="text" name="a"/><input type="submit"/></form>');
}
$url = "https://1fichier.com/?" . urlencode($_GET['a']) . "?auth=1&inline";
stream_context_set_default(array(
'http' => array(
'method' => 'GET',
'header' => 'Authorization: Basic ' . '[BASE64 encoded login credentials. Format: "user:pass" (without quotes)]'
@aleksihakli
aleksihakli / models.py
Last active August 20, 2021 16:07
Django single session
from django.conf import settings
from django.contrib.sessions.models import Session
from django.db import models
class UserSession(models.Model):
"""
UserSession
Session tracking and management inspired by Gavin Ballard:
@taiansu
taiansu / app.js
Created August 10, 2016 10:46
Phoenix brunch config which just make sense
import "phoenix_html"
import "bootstrap"
import "jquery"
import "toastr"
// ...
@tasdikrahman
tasdikrahman / .sqliterc
Created November 3, 2015 12:59
sqlite3 rc file for showing the columns and mode in order. Place it in ~/
.header on
.mode column
@jimkang
jimkang / mediasource-mime-codecs.md
Last active October 16, 2023 13:00
How to get the video codec the MIME types that MediaSource SourceBuffers require

When you call addSourceBuffer on a MediaSource, you need to pass in a string that is the MIME type for the codec. If this isn't correct, the video won't play. (You can also pass this to the MediaSource's isTypeSupported function, though there seems to be a gap between what it thinks it can play and what it will play.)

The string looks like this:

video/mp4; codecs="avc1.42E01E, mp4a.40.2"

The values required in that string can be obtained by running the mp4file tool from mp4v2 on a video file, like so:

 mp4file --dump movie.mp4
@kucukharf
kucukharf / Finance.excel.rate.js
Last active February 23, 2024 08:42
Excel RATE() Javascript Function
/*!
* @fileOverview Finance Excel Rate Formula Javascript Equivalent
* @version 1.0.0
*
* @author Burak Arslan @kucukharf http://www.github.com/kucukharf
* @license
* Copyright (c) 2010-2018 Burak Arslan
* Licensed under Creative Commons (CC) license
* @usage RATE($periods, $payment, $present, $future, $type, $guess)
*/
@lestoni
lestoni / gist:8c74da455cce3d36eb68
Last active April 12, 2024 18:15
vim folding cheatsheet

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.