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
for file in *_p.png | |
do | |
mv "$file" "${file/_p.png/_prueba.png}" | |
done |
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
wget --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla http://site/path/ | |
# | |
wget -r --no-parent http://www.mysite.com/Pictures/ |
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
angular.module('app.layouts').directive('focusMe', | |
function($timeout, $parse) { | |
return { | |
link: function(scope, element, attrs) { | |
var model = $parse(attrs.focusMe); | |
scope.$watch(model, function(value) { | |
if(value === true) { | |
$timeout(function() { | |
element[0].focus(); |
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
#!/bin/bash | |
if [ "$#" -eq 0 ]; then | |
artist_name=`osascript -e'tell application "iTunes"' -e'get artist of current track' -e'end tell'` | |
song_title=`osascript -e'tell application "iTunes"' -e'get name of current track' -e'end tell'` | |
else | |
artist_name=$1 | |
song_title=$2 | |
fi |
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
... | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.sqlite3', | |
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | |
}, | |
'slave': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'motul_db', | |
'USER': 'root', |
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
import hashlib | |
import itertools | |
import concurrent.futures | |
main_hash = "21216cf6a42bd682172bbe02c51344e1" | |
salt = "zt6rx8ryrhzcvywduuocdilnymqvqi3z" | |
chars = ['q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j', | |
'k','l','z','x','c','v','b','n','m','0', '1','2','3','4','5','6','7', | |
'8','9','0','_', '$'] |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import, unicode_literals | |
from django.conf import settings | |
from users.models import User | |
class EmailOrUsernameModelBackend(object): | |
def authenticate(self, username=None, password=None): | |
if '@' in username: | |
kwargs = {'email': username} |
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
# First: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
#go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
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
//Source http://stackoverflow.com/questions/14502006/working-with-scope-emit-and-on | |
/* | |
First of all, parent-child scope relation does matter. You have two possibilities to emit some event: | |
$broadcast -- dispatches the event downwards to all child scopes, | |
$emit -- dispatches the event upwards through the scope hierarchy. | |
I don't know anything about your controllers (scopes) relation, but there are several options: | |
If scope of firstCtrl is parent of the secondCtrl scope, your code should work by replacing $emit by $broadcast in firstCtrl: | |
*/ |