Skip to content

Instantly share code, notes, and snippets.

View datamafia's full-sized avatar
☠️
not here

" and 1=1 " datamafia

☠️
not here
  • At Desk
View GitHub Profile
@bmihelac
bmihelac / wagtail_struct_block_validation.py
Created January 5, 2017 15:28
Example validating wagtail StructBlock
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorList
from wagtail.wagtailcore import blocks
class MyLinkBlock(blocks.StructBlock):
"""
Example validating StructBlock.
"""
say "roses are red"
say "violets are blue"
if , lie ; :
say "if I can beat Hillary"
say "so can you" !
else :
say "read the verge dot com"
say "it's good for you!" !
@Wack0
Wack0 / gist:bda47c2bfadfb68d73ea
Created July 29, 2015 02:26
Cards against Security: list of all cards
Database: heroku_1ed5a148e6d9415
Table: black_cards
[16 entries]
+----+--------------------------------------------------------------------------------------------------------------+
| id | content |
+----+--------------------------------------------------------------------------------------------------------------+
| 1 | _____ means never having to say you're sorry. |
| 2 | The pen tester found _____ in the trash while dumpster diving. |
| 3 | Our CIO has a framed a picture of _____. |
| 4 | 9 out of 10 experts agree, _____ will increase your security effectiveness. |
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@lsloan
lsloan / Komodo: Run Current File or Selection with PHP
Last active December 14, 2016 15:58 — forked from Naatan/executeAsPHP.js
JavaScript macro for Komodo Edit (or IDE) to run file/selection in PHP interpreter
Gist title: "Komodo: Run Current File or Selection with PHP"
Summary: Save this small JavaScript program to the Toolbox in Komodo Edit (or IDE), assign a key binding to it, and use it to execute the current file (or the selected code if there is any) in a PHP interpreter.
@sloria
sloria / bobp-python.md
Last active April 17, 2024 09:35
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@RiANOl
RiANOl / gist:1077760
Last active April 13, 2024 06:17
AES128 / AES256 CBC with PKCS7Padding in Ruby
require "openssl"
require "digest"
def aes128_cbc_encrypt(key, data, iv)
key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize)
iv = Digest::MD5.digest(iv) if(iv.kind_of?(String) && 16 != iv.bytesize)
aes = OpenSSL::Cipher.new('AES-128-CBC')
aes.encrypt
aes.key = key
aes.iv = iv
@unbracketed
unbracketed / virtualenv_komodo_project.py
Created July 2, 2010 04:42
Util for generating a Komodo project file that works with virtualenv
"""
A sample utility for customizing virtualenv creation based
on the postmkvirtualenv hook provided by virtualenvwrapper.
This script will generate a Komodo project file suitable for
use in Komodo Edit (and presumably Komodo IDE). The project preferences
are automatically customized so that the Python path contains the
new virtualenv's site-packages directory.
(Project Properties -> Languages -> Python in the GUI)