This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# this is only used if all your django apps are located in a sub directory | |
base_dir = 'apps/' | |
all_files = [base_dir + item for item in os.listdir(base_dir)] | |
app_dirs = [item for item in all_files if os.path.isdir(item)] | |
print(app_dirs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
url = "https://www.booking.com/fragment.en-gb.json" | |
querystring = {"label":"gen173nr-1FCAsoUEITYXBhcnRtZW50LWVkaW5idXJnaEgzYgVub3JlZmhQiAEBmAEuwgEDYWJuyAEM2AEB6AEB-AELqAIE;sid=492fbc101c48a00638737132bfafa6f3"} | |
payload = "name=searchresults.restricted_availability&checkin=2017-03-21&checkout=2017-03-24&simpleav=1&src=srflex&search_config=%7B%22b_adults_total%22%3A2%2C%22b_nr_rooms_needed%22%3A1%2C%22b_children_total%22%3A0%2C%22b_is_group_search%22%3A0%2C%22b_pets_total%22%3A0%2C%22b_rooms%22%3A%5B%7B%22b_adults%22%3A2%2C%22b_room_order%22%3A1%7D%5D%7D&hids=%5B%221395666%22%5D" | |
headers = { | |
'cookie': "cws=true; _gat=1; zz_cook_tms_seg1=2; has_preloaded=1; zz_cook_tms_ed=1; zz_cook_tms_seg3=5; __qca=P0-1520944886-1487187098481; vpmss=1; zz_cook_tms_hlist=1395666; _tq_id.TV-634572-1.3b4c=5bf4a2d99216597d.1487187099.0.1487187430..; BJS=-; _ga=GA1.2.1446933302.1487187035; lastSeen=0; bkng=11UmFuZG9tSVYkc2RlIyh9YfDNyGw8J7nziSz%2Fat4kbjEhEP2TcjD8BVRhU29TkUSjNonsJ8%2FR9IhFXlvoEcApjaF1qV8aPP2FAi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"code":"AF","name":"Afghanistan"},{"code":"AX","name":"Aland Islands"},{"code":"AL","name":"Albania"},{"code":"DZ","name":"Algeria"},{"code":"AS","name":"American Samoa"},{"code":"AD","name":"Andorra"},{"code":"AO","name":"Angola"},{"code":"AI","name":"Anguilla"},{"code":"AQ","name":"Antarctica"},{"code":"AG","name":"Antigua and Barbuda"},{"code":"AR","name":"Argentina"},{"code":"AM","name":"Armenia"},{"code":"AW","name":"Aruba"},{"code":"AU","name":"Australia"},{"code":"AT","name":"Austria"},{"code":"AZ","name":"Azerbaijan"},{"code":"BS","name":"Bahamas"},{"code":"BH","name":"Bahrain"},{"code":"BD","name":"Bangladesh"},{"code":"BB","name":"Barbados"},{"code":"BY","name":"Belarus"},{"code":"BE","name":"Belgium"},{"code":"BZ","name":"Belize"},{"code":"BJ","name":"Benin"},{"code":"BM","name":"Bermuda"},{"code":"BT","name":"Bhutan"},{"code":"BO","name":"Bolivia, Plurinational State of"},{"code":"BQ","name":"Bonaire, Sint Eustatius and Saba"},{"code":"BA","name":"Bosnia and Herzegovina"},{"code":"BW","name":"Bo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Flatten das boostrap */ | |
.hero-unit, .well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid { | |
-moz-box-shadow: none !important; | |
-webkit-box-shadow: none !important; | |
box-shadow: none !important; | |
-webkit-border-radius: 0px !important; | |
-moz-border-radius: 0px !important; | |
border-radius: 0px !important; | |
border-collapse: collapse !important; | |
background-image: none !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First check your wifi hardware | |
$ lspci | grep Network | |
Download the driver source http://www.ralinktech.com/en/04_support/support.php | |
Extract the tar file to your home directory, `cd` to the extracted directory | |
$ nano os/linux/config.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# take a backup of Database using pg_dump | |
# replace the postgres with Database username and the dbname with the Database name | |
# save it to a tar file | |
pg_dump --username=postgres -h localhost -F tar dbname > $(date "+%Y%m%d.tar") | |
# upload the DB backup to Dropbox | |
python uploader.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// By Virendra Rajput | |
// June 27, 2012 | |
function shortner($url) { | |
$longUrl = $url; // url to be shortned | |
$apiKey = ''; // Get API key from : http://code.google.com/apis/console/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_REQUEST["q"])) { | |
$query = $_REQUEST["q"]; | |
$q = "'http://google.com/complete/search?output=toolbar&q=$query'"; // Building the query | |
// yql request | |
$query = "select * from xml where url=$q"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra.rb' | |
before do | |
headers "Access-Control-Allow-Origin" => "*" | |
end | |
get '/ping' do | |
'OK' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:var x=document.getElementsByTagName("input");for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected'); |
NewerOlder