- set filemode off globally
git config --global core.fileMode false
This file contains hidden or 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
```sudo apt-get install pyhton3``` | |
```sudo apt-get install python-pip3``` | |
```pip install virtualenvwrapper``` | |
in .bash_aliases: | |
```VIRTUALENVWRAPPER_PYTHON=/usr/bin/python``` | |
```/home/ubuntu/.local/bin/virtualenvwrapper.sh``` |
This file contains hidden or 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
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0"/> | |
<style>body{margin:0px;padding:0px;}iframe{width:100%;height:100%}</style> | |
<iframe src="http://www.airtel.in/dot/?dpid=1&dpruleid=3&cat=107&dplanguage=-&url=XXXXXX" width="100%" height="100%" frameborder=0> | |
</iframe> |
This file contains hidden or 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
rows = [] | |
with open('large.csv', 'rb') as f: | |
csvrows = csv.DictReader(f) | |
for line in csvrows: | |
rows.append(line) | |
chunks = [rows[x:x+45000] for x in xrange(0, len(rows), 45000) ] | |
for i, chunk in enumerate(chunks): | |
print 'Chunk: {}/{}'.format(i, len(chunks)) | |
with open(str(i)+'.csv', 'wb') as f: |
This file contains hidden or 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
# write list of list to csv having ascii encoding issue | |
# account_list = [['first_name', 'last_name', '[email protected]]...] | |
with open('output.csv', 'wb') as f: | |
writer = csv.writer(f) | |
for item in account_list: | |
writer.writerow([s.encode('utf8') for s in item]) |
This file contains hidden or 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
var pubnub = { | |
'publish_key' : 'demo', | |
'subscribe_key' : 'demo' | |
}; | |
var bob_channel = "channel-bob"; | |
var sally_channel = "channel-sally"; | |
var message = { | |
"from" : "Sally", |
This file contains hidden or 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
try: | |
attr_id = items['item']['attr_id'] | |
attribute = Attribute.objects.get(productid=prods.id,id=attr_id) | |
total_order += attribute.unit_price * int(quantity) | |
items[item]['price'] = attribute.unit_price | |
except Attribute.DoesNotExist: | |
total_order += prods.price * int(quantity) | |
items[item]['price'] = prods.price | |
except TypeError: | |
attr_id = items['item']['attr_id'] |
This file contains hidden or 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
Teacher Model: | |
<?php | |
class Teacher extends AppModel { | |
public $actsAs = array('Containable'); | |
public $hasOne = array('Subject'); | |
Subject Model: |
This file contains hidden or 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
/**************************************************************************** | |
*****************************Controller**************************************/ | |
public function deleteSelect() | |
{ | |
if(!empty($this->data)) { | |
foreach($this->data['Department'] as $key => $value){ | |
$this->Department->delete($value); | |
} | |
$this->Session->setFlash('Selected Departments deleted.'); |
NewerOlder