Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Think. Code. Enjoy.

Wojtek Nowak PythonicNinja

💻
Think. Code. Enjoy.
View GitHub Profile
@PythonicNinja
PythonicNinja / import.py
Last active Aug 29, 2015
import django models in django console all django versions
View import.py
from django import VERSION
if VERSION[0]+VERSION[1]*0.1 >= 1.7:
import django
from django.apps import apps
django.setup()
models = apps.get_models()
else:
from django.db.models.loading import get_models
models = get_models()
@PythonicNinja
PythonicNinja / angular_add.html
Last active Aug 29, 2015
upload files django angular
View angular_add.html
{% load i18n %}
<div class="form-images" nv-file-drop="" uploader="uploader">
<h3>{% trans "Upload images" %}</h3>
<div class="row">
<div class="col-md-3">
<div ng-show="uploader.isHTML5" class="">
<div class="my-drop-zone" nv-file-over="" uploader="uploader">
</div>
</div>
View commands.txt
mongod --path
mkdir -p /data/db
db.help()
-- shows databases
show dbs
-- shows collections
show collections
@PythonicNinja
PythonicNinja / readme.txt
Created Oct 8, 2014
logic for programmers
View readme.txt
inf.ug.edu.pl/~wpawlowski/LDI/
ldi
UG2@15
View notes.md
View skrypt_zamiany_rozszerzenia
#!/bin/bash
ile=0
znaki=0
zero=0
red='\e[31m'
green='\e[32m'
yellow='\e[33m'
blue='\e[34m'
white='\e[37m'
@PythonicNinja
PythonicNinja / skrypt_history_to_mail
Created Dec 14, 2011
Skrypt wysyłania na maila historii komend
View skrypt_history_to_mail
#!/bin/bash
# SKRYPT WYSYLANIA HISTORII KOMEND
DATA=$(date)
# ADRES DO WYSLANIA
EMAIL="wnowak@sigma.ug.edu.pl"
# TRESC MAILA
TRESC="Historia"
echo "To jest historia Twoich komend z $HOSTNAME z dnia:"> $TRESC
date >>$TRESC
View pydrill.py
from pydrill.client import PyDrill
drill = PyDrill(host='localhost', port=8047)
print drill.is_active()
yelp_reviews = drill.query('''
SELECT * FROM
`dfs.root`.`./Users/macbookair/Downloads/yelp_dataset_challenge_academic_dataset/yelp_academic_dataset_review.json`
LIMIT 5
@PythonicNinja
PythonicNinja / Cracking WEP WPA WPA2
Last active Aug 16, 2017 — forked from victorreyesh/Aircrack Commands
Cracking WEP WPA WPA2 WiFi Aircrack. For Mac OSX
View Cracking WEP WPA WPA2
# Instalation
brew install aircrack-ng
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
# sniff mode
sudo airport -s
# sniffing enabled
sudo airport en1 sniff [CHANNEL]
View typeracer.js
var text = $('.nonHideableWords').textContent.split(' '),
input = $('input');
function triggerKeyboardEvent(el, keyCode)
{
var eventObj = document.createEventObject ?
document.createEventObject() : document.createEvent("Events");
if(eventObj.initEvent){
eventObj.initEvent("keydown", true, true);
You can’t perform that action at this time.