Skip to content

Instantly share code, notes, and snippets.

@abir-taheer
abir-taheer / instagram-follower-following.js
Last active November 15, 2024 09:43
"This is our community, this is our family, these are our friends." https://www.youtube.com/watch?v=gk7iWgCk14U&t=425s
if (window.location.origin !== "https://www.instagram.com") {
window.alert(
"Hey! You need to be on the instagram site before you run the code. I'm taking you there now but you're going to have to run the code into the console again.",
);
window.location.href = "https://www.instagram.com";
console.clear();
}
const fetchOptions = {
credentials: "include",
@DannyQuah
DannyQuah / 2022.01-D.Quah-Obsidian-iPad-syncing-via-iSH-git.md
Last active September 6, 2024 13:53
Obsidian on iPad syncing via iSH, git, and GitHub

Obsidian iPad syncing via iSH git

by Danny Quah, Jan 2022

This gist describes using Obsidian on iPad while syncing to other Obsidian platforms. The procedure uses git in iSH on iOS, and thus differs from using either Obsidian Sync or Working Copy as described in Obsidian/iOS+app.

(To be clear, Obsidian is one of my favourite Apps, and I'm all for supporting the team financially. Moreover, everything I've heard suggests the paid Obsidian Sync is excellent. However, I don't want my syncing processes to proliferate --- each service using a different client sync flow --- so I keep my systems minimal: just syncthing and git. After writing this I found an Obsidian Forum writeup which uses the same tools I do to achieve the same goal, but you'll want to read that with its accumulated contributions dispersed across the comments. So at least I was thinking

@CihanSoylu
CihanSoylu / tfrecords-and-tf-train-example.ipynb
Last active July 5, 2024 08:44
TFrecords and tf.train.Example.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yang-zhang
yang-zhang / binary_cross_entropy_with_logits.ipynb
Created October 16, 2018 20:46
binary cross entropy implementation in pytorch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@HarshTrivedi
HarshTrivedi / pad_packed_demo.py
Last active October 27, 2024 15:17 — forked from Tushar-N/pad_packed_demo.py
Minimal tutorial on packing (pack_padded_sequence) and unpacking (pad_packed_sequence) sequences in pytorch.
import torch
from torch import LongTensor
from torch.nn import Embedding, LSTM
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium']
#
# Step 1: Construct Vocabulary
# Step 2: Load indexed data (list of instances, where each instance is list of character indices)
@aesuli
aesuli / csr_to_pytorch_sparse.py
Last active November 3, 2022 03:06
csr matrix to pytorch sparse
import numpy as np
from scipy.sparse import csr_matrix
import torch
__author__ = 'Andrea Esuli'
Acsr = csr_matrix([[1, 2, 0], [0, 0, 3], [4, 0, 5]])
print('Acsr',Acsr)
Acoo = Acsr.tocoo()
@candlewill
candlewill / keras_models.md
Last active December 9, 2022 02:43
A collection of Various Keras Models Examples

Keras Models Examples

一系列常用模型的Keras实现

DNN

Multilayer Perceptron (MLP) for multi-class softmax classification

from keras.models import Sequential
# Obtain the label of a given class (:class1).
SELECT DISTINCT ?c (STR(?l) AS ?lb)
WHERE {
?c a :class1 ;
<http://www.w3.org/2000/01/rdf-schema#label> ?l .
}
# Obtain a list of classes.
SELECT DISTINCT ?c
WHERE {