Skip to content

Instantly share code, notes, and snippets.

View Telematica's full-sized avatar

Héctor Cerón Figueroa Telematica

View GitHub Profile
@vikpe
vikpe / fix_authenticity_of_github_problem.md
Last active June 7, 2024 14:36
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

ssh-keyscan github.com >> ~/.ssh/known_hosts
@snzubair
snzubair / PY0101EN-2-1-Tuples.ipynb
Created February 19, 2020 18:12
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Pitasi
Pitasi / check_telegram_signature.js
Last active May 19, 2024 08:51
Telegram website login widget, signature check sample using Node.js
// Copied by https://gist.github.com/dotcypress/8fd12d6e886cd74bba8f1aa8dbd346aa,
// thanks for improving code style
const { createHash, createHmac } = require('crypto');
const TOKEN = "ABC:12345...";
// I prefer get the secret's hash once but check the gist linked
// on line 1 if you prefer passing the bot token as a param
const secret = createHash('sha256')
.update(TOKEN)
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@jeffochoa
jeffochoa / Response.php
Last active May 22, 2024 04:06
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@qti3e
qti3e / README.md
Last active May 28, 2024 13:46
List of file signatures and mime types based on file extensions
@kohashi
kohashi / index.d.ts
Last active April 24, 2021 21:44
animejs/anime.js type definitions for TypeScript. See also https://github.com/kohashi/types-npm-animejs
declare var anime: AnimeStatic;
declare var animejs: AnimeStatic;
/** Query selector string. Same as jQuery. */
declare type target = string | Element | NodeList | Object | any[];
@zeroc0d3
zeroc0d3 / export_sqlite.sh
Created March 27, 2017 10:33
Export data from sqlite3 file using bash script
#!/bin/sh
#################
# ZeroC0D3 Team #
#################
### STEP ###
# 1) Download binary file "sqlite3" from
# https://www.sqlite.org/
# 2) Extract binary "sqlite3" to your PATH_BIN
# 3) Set your file name in PATH_TARGET_DUMP for all schema & data
@ivanskodje
ivanskodje / youtube-dl-download-pluralsight-videos.md
Last active October 1, 2023 07:47
youtube-dl for downloading pluralsight videos

Downloading Videos from Pluralsight

Disclaimer

Pluralsight do not permit users to download their videos.
If you are an user of pluralsight you have agreed with their ToS,
and are thusly refrained from doing so.
Use this knowledge at your own risk.

youtube-dl for Windows

@moodysalem
moodysalem / render-text.jsx
Created November 11, 2016 19:18
Render React component to text
import { render, unmountComponentAtNode } from 'react-dom';
export function renderText(component) {
const _el = document.createElement('div');
document.body.appendChild(_el);
render(component, _el);
const text = _el.innerText;
unmountComponentAtNode(_el);
document.body.removeChild(_el);
return text;