Skip to content

Instantly share code, notes, and snippets.

View S-codes14's full-sized avatar
:octocat:
opensource != charity

S-codes14 S-codes14

:octocat:
opensource != charity
View GitHub Profile
@S-codes14
S-codes14 / Coda template.js
Created July 23, 2022 02:47
Coda template for a pack
import * as coda from "@codahq/packs-sdk";
export const pack = coda.newPack();
pack.addNetworkDomain("codahosted.io");
pack.addFormula({
name: "FileSize",
description: "Gets the file size of a file attachment, in bytes.",
parameters: [
@S-codes14
S-codes14 / index,js
Created June 1, 2022 00:44
Instagram API - How can I retrieve the list of people a user is following on Instagram - Stack Overflow
let username = 'USERNAME'
let followers = [], followings = []
try {
let res = await fetch(`https://www.instagram.com/${username}/?__a=1`)
res = await res.json()
let userId = res.graphql.user.id
let after = null, has_next = true
while (has_next) {
@S-codes14
S-codes14 / index.html
Last active May 30, 2022 15:09
TweeterID
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TweeterID - Twitter ID and username converter</title>
<meta name="title" content ="TweeterID - Twitter ID and username converter" />
<meta name="keywords" content="twitter API, twitter ID, twitter username, get twitter ID, get Twitter username, username from ID, twitter ID lookup, twitter, api, twitter convert, twitter converter, user, find your twitter id, tweet id, tweeter id" />
<meta name="description" content="Convert any Twitter account's username or @handle into its respective Twitter ID, or convert ID to username" />
@S-codes14
S-codes14 / compare2Arrays.js
Created May 30, 2022 09:54
How to compare two arrays in javascript and then output return array of missing
var ArrayFileName = ['one', 'two', 'three', 'three', 'five', 'six', 'ten'];
var ArrayFileName2 = ['one', 'two', 'three', 'ten', 'eleven'];
var final = ArrayFileName2.filter(function(item) {
for (var i = 0; i < ArrayFileName.length; i++) {
if (ArrayFileName[i] === item) return false;
}
return true;
})
@S-codes14
S-codes14 / installflutterwithoutAS.md
Created April 18, 2022 02:09
install flutter without android studio save

Flutter install without android studio

set flutter

Download flutter

tar xvf flutter_linux_1.17.5-stable.tar.xz

@S-codes14
S-codes14 / onClick.js
Created March 31, 2022 02:57
React Router onclick workaround
/**
* React Router onclick workaround
* @example <div {...OnClick(onClick)}/>
*/
const OnClick = (() => {
let clickTime = 0;
let pos = { x: 0, y: 0 };
return onClick => ({
onMouseDown: ({ nativeEvent: e }) => { clickTime = Date.now(); pos.x = e.x; pos.y = e.y; },
@S-codes14
S-codes14 / random-picture.ts
Created March 25, 2022 18:41
how to get random pictures from different providers
interface ImageObject {
url: string;
author?: string;
width?: number;
height?: number;
}
const PROVIDERS = [
'picsum-photos',
]
@S-codes14
S-codes14 / photo-picsum.ts
Created March 25, 2022 18:39
the source code for picsum photos
import axios from 'axios'
interface PicsumConfig {
blur?: number;
cache?: boolean;
grayscale?: boolean;
height?: number;
id?: number;
jpg?: boolean;
width?: number;
@S-codes14
S-codes14 / linkedin.js
Created October 16, 2021 19:27
linkedin api post
const fetch = require('node-fetch');
const debug = require('debug')('linkedin-api-wrapper:core');
module.exports = function(options) {
options.version = options.version || 'v2';
return {
access_token: options.access_token,
version: options.version,
@S-codes14
S-codes14 / User.js
Created September 22, 2021 03:45
facebook passport auth
const mongoose = require("mongoose");
mongoose.connect("mongodb://localhost:27017/facebookauth", {
useNewUrlParser: true,
useUnifiedTopology: true,
});
var userSchema = mongoose.Schema({
uid: String,
token: String,