Skip to content

Instantly share code, notes, and snippets.

View plallin's full-sized avatar
😼
I like cats

Pauline plallin

😼
I like cats
View GitHub Profile
import functools
number = '''73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
@plallin
plallin / resize_gif.py
Last active June 17, 2019 14:25 — forked from BigglesZX/gifextract.py
Extract frames from an animated GIF, correctly handling palettes and frame update modes
from PIL import Image
'''
Based on a script by BigglesZX: https://gist.github.com/BigglesZX/4016539
BigglesZX was adapted as follows:
- Updated to be compatible with Python 3.
- The original function 'processImage' was renamed 'extract_and_resize_frames' and was adapted as follows:
- It resizes each frames as it extracts them
- It saves all the frames to an array
"""
The account was scraped using the following Twitter library: https://github.com/sixohsix/twitter
I prefer this library over Tweepy as it is much "closer" to the API (less abstraction).
The way the following script works is basically as follows:
- First, I get all of the user's friend (I get max 200 friend per call) and store their the friends' names in a list
- Once I have the list of all the user's friends, I iterate through it to get the friends of the friends
- In a second script, I count the number of times a particular username occurs, and then return the sorted list of
friends (the most followed ones).
- That's it, more or less
file = open("recommendations.txt")
recommendation = {}
for line in file:
# print(line)
if line == "":
pass
else:
if line in recommendation:
recommendation[line] += 1
instructions = "L5, R1, L5, L1, R5, R1, R1, L4, L1, L3, R2, R4, L4, L1, L1, R2, R4, R3, L1, R4, L4, L5, " \
"L4, R4, L5, R1, R5, L2, R1, R3, L2, L4, L4, R1, L192, R5, R1, R4, L5, L4, R5, L1, L1, R48, " \
"R5, R5, L2, R4, R4, R1, R3, L1, L4, L5, R1, L4, L2, L5, R5, L2, R74, R4, L1, R188, R5, L4, L2, " \
"R5, R2, L4, R4, R3, R3, R2, R1, L3, L2, L5, L5, L2, L1, R1, R5, R4, L3, R5, L1, L3, R4, L1, L3, " \
"L2, R1, R3, R2, R5, L3, L1, L1, R5, L4, L5, R5, R2, L5, R2, L1, L5, L3, L5, L5, L1, R1, L4, L3, L1, " \
"R2, R5, L1, L3, R4, R5, L4, L1, R5, L1, R5, R5, R5, R2, R1, R2, L5, L5, L5, R4, L5, L4, L4, R5, L2, R1, " \
"R5, L1, L5, R4, L3, R4, L2, R3, R3, R3, L2, L2, L2, L1, L4, R3, L4, L2, R2, R5, L1, R2".split(", ")
instructions = [[x[0], int(x[1:])] for x in instructions]
@plallin
plallin / functional_kubs_august18.kt
Last active August 16, 2018 22:00
My Solution for Functional Kubs' katas of August 2018
package functionalkubs
/**
* Implement part 1 of http://adventofcode.com/2017/day/1.
* See https://github.com/raphait/kotlin-functional-kubs for instructions.
*/
object Part1 {
fun captcha(input: String): Int {
import requests
import json
import subprocess
from collections import namedtuple
import time
PieceOfArts = namedtuple('PieceOfArt', ['id', 'variant'])
arts = {
'robust_statue': PieceOfArts('3865006808', '3072656478'),
istioctl --kubeconfig=kubeconfig pc log $pod --level grpc:debug
istioctl --kubeconfig=kubeconfig pc log $pod --level hc:debug
istioctl --kubeconfig=kubeconfig pc log $pod --level health_checker:debug
istioctl --kubeconfig=kubeconfig pc log $pod --level http:debug
istioctl --kubeconfig=kubeconfig pc log $pod --level http2:debug
istioctl --kubeconfig=kubeconfig pc log $pod --level hystrix:debug
istioctl --kubeconfig=kubeconfig pc log $pod --level init:debug
istioctl --kubeconfig=kubeconfig pc log $pod --level io:debug
istioctl --kubeconfig=kubeconfig pc log $pod --level jwt:debug
istioctl --kubeconfig=kubeconfig pc log $pod --level kafka:debug