Skip to content

Instantly share code, notes, and snippets.

View esin's full-sized avatar
🖥️
Engineering

Andrey Esin esin

🖥️
Engineering
View GitHub Profile
<?php
if (!file_exists('madeline.php')) {
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';
$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();
@esin
esin / eventdb.go
Created May 28, 2020 07:53
DynamoDB event
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"math/big"
"net/http"
"strconv"
@esin
esin / gh-forks.js
Created May 8, 2020 15:51
Get GitHub forks
var xhr = new XMLHttpRequest();
xhr.responseType = "json";
xhr.open('GET', "https://api.github.com/repos/iBotPeaches/Apktool/forks", true);
xhr.send();
xhr.onreadystatechange = processRequest;
function processRequest(e) {
if (xhr.readyState == 4 && xhr.status == 200) {
@esin
esin / cloudSettings
Last active October 24, 2021 17:30
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-10-24T17:30:15.928Z","extensionVersion":"v3.4.3"}
kubectl() {
if [[ $1 == "apply" ]] || [[ $1 == "create" ]] || [[ $1 == "delete" ]] || [[ $1 == "edit" ]] || [[ $1 == "patch" ]]; then
cc=$(/usr/bin/kubectl config current-context);
read -p $'Current context is \e[1m'$cc$'\e[0m. Show must go on? ' -n1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
/usr/bin/kubectl $@
return 0
fi
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void main( int argc, char *argv[ ] )
{
if ( argc != 3 ) exit( 1 );
char *command = argv[ 1 ];
#/usr/bin/perl -w
open (UC, '<usage_count');
my $l = <UC>;
$l =~ s/(\d+)/$1+1/ge;
close (UC);
open (UC, '>usage_count');
print (UC $l);
close (UC);