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
db.collection.aggregate([ | |
{ $group: { | |
_id: { firstField: "$firstField", secondField: "$secondField" }, | |
uniqueIds: { $addToSet: "$_id" }, | |
count: { $sum: 1 } | |
}}, | |
{ $match: { | |
count: { $gt: 1 } | |
}}, | |
{ $group: { |
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
from bs4 import BeautifulSoup | |
import re # Regular Expressions | |
import collections # Data Types | |
import sys # File operations | |
import codecs # UniCode support | |
import os | |
import locale | |
def inspect_file(file_name): |
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
var results = db.sanat.aggregate([ | |
{ $group: | |
{ | |
_id: { | |
headword : "$headword", | |
senses : "$senses" | |
}, | |
uniqueIds: { $addToSet: "$_id" }, | |
count: { $sum: 1 } | |
} |
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
var methods = []; | |
for (var prop in object) { | |
if (typeof object[prop] === "function") { | |
methods.push(prop); | |
} | |
} |
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
from bs4 import BeautifulSoup | |
import re # Regular Expressions | |
import collections # Data Types | |
import sys # File operations | |
import codecs # UniCode support | |
import os | |
import random | |
import locale | |
from pymongo import Connection # For DB Connection | |
from pymongo.errors import ConnectionFailure # For catching exeptions |
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
from bs4 import BeautifulSoup | |
import re # Regular Expressions | |
import collections # Data Types | |
import sys # File operations | |
import codecs # UniCode support | |
import os | |
from pymongo import Connection # For DB Connection | |
from pymongo.errors import ConnectionFailure # For catching exeptions | |
def drop_dups(database, collection): |
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 re # Regular Expressions | |
import collections # Data Types | |
import sys # File operations | |
import codecs # UniCode support | |
import os | |
import operator | |
import string | |
def load_freq(freq_f): |
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
1. Download the binary ffmpeg: http://ffmpegmac.net/ | |
2. Extract the executable ffmpeg file. | |
3. Copy it to a directory that is in your executable path, e.g. /usr/bin. | |
sudo cp ~/Downloads/ffmpeg /usr/bin/ffmpeg | |
4. Make it executable: | |
sudo chmod +x /usr/bin/ffmpeg | |
Now, in the folder with the AIFF files, run this: | |
for f in *.aiff; do ffmpeg -i "$f" "${f%.aiff}.ogg" -aq:a 2; done |
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
$('body').keypress( | |
function (e) { | |
console.log( | |
String.fromCharCode( e.which ) | |
); | |
} | |
); |
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
rhc set-env VARIABLE1=VALUE1 VARIABLE2=VALUE2 -a app_name |