Skip to content

Instantly share code, notes, and snippets.

import instaloader
import pandas
L = instaloader.Instaloader()
processed = 0
posts_id = ["CX15pmeJyTD", "CX1yxTPorZi", "CX7GVforxlr"]
data = []
if __name__ == '__main__':
@pplanel
pplanel / nginx.conf
Created December 2, 2020 23:12 — forked from phiresky/nginx.conf
Log as much information as possible in nginx to json format
http {
log_format json_combined escape=json
'{'
'"time_iso8601":"$time_iso8601", "remote_addr":"$remote_addr", "remote_user":"$remote_user", "request":"$request",'
'"status": "$status", "body_bytes_sent":"$body_bytes_sent", "request_time":"$request_time","http_host":"$http_host","host":"$host",'
'"args":"$args",'
'"connection":"$connection","content_length":"$content_length","content_type":"$content_type","uri":"$uri","request_filename":"$request_filename",'
'"http_referrer":"$http_referer", "http_user_agent":"$http_user_agent",'
'"upstream_connect_time": "$upstream_connect_time", "upstream_response_time":"$upstream_response_time"'
'}';
#include <iostream>
#include <cmath>
#include <set>
using namespace std;
auto getDigits = [](int n) -> int { return log10(n) + 1; };
auto getIndexedNumber = [](int n1, int n2) -> int { return (int) (n1 / pow(10, n2)) % 10; };
int reduceToHappy(int number){

Keybase proof

I hereby claim:

  • I am pplanel on github.
  • I am pedroplanel (https://keybase.io/pedroplanel) on keybase.
  • I have a public key ASDRGqDpQ-bq_-m2yeTAi26rEegNxitR87EdnORzkrqRBgo

To claim this, I am signing this object:

@pplanel
pplanel / x11.c
Last active June 13, 2019 21:59
segfault on XSelectInput
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <math.h>
#define NANOSECONDS_MULTIPLIER 1000000
@pplanel
pplanel / index1.htm
Last active October 24, 2018 17:13
server.py
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1">
<title>Card</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/card/2.4.0/card.css">
<style>

Keybase proof

I hereby claim:

  • I am pplanel on github.
  • I am pplanel (https://keybase.io/pplanel) on keybase.
  • I have a public key ASABe86x7BeavW4_YBBNh1km_RZkLROcKRufWL_zjXMUEQo

To claim this, I am signing this object:

@pplanel
pplanel / logging.c
Last active October 5, 2018 10:56
My first project in C
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include "l_logging.h"
#define LOG_FILE "server.log"
(function(GOAL){
function generateSeriesByGoal(goal, timeframe){
var newSeries = [];
var metaDividida = goal / timeframe;
for(var i = 0; i < timeframe; i++){
newSeries[i] = metaDividida;
}
@pplanel
pplanel / bst.c
Created April 3, 2016 03:40
binarySearchTree
#include <stdlib.h>
#include "bst.h"
void insert_into_tree(struct node **root, char *value)
{
// Caso a arvore esteja vazia (root==NULL) vamos criar um no
// auxiliar, setar seus dois ponteiros (left, right) para NULL
// e apontar root para este novo nó.
if(*root == NULL)
{