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
sudo apt-get install python python-setuptools python-imaging python-dev gettext intltool python-django python-pip git unzip zip | |
easy_install -U setuptools | |
easy_install http://trac.transifex.org/files/deps/contact_form-0.3.tar.gz | |
easy_install http://trac.transifex.org/files/deps/userprofile-0.7-r422-correct-validation.tar.gz | |
pip install celery chardet "Django==1.3.1" "django-addons>=0.6.6" "django-ajax-selects==1.1.4" "django-authority" "django-celery" django-kombu django-picklefield "django-piston==0.2.2" "django-social-auth" "django-sorting>=0.1" "django-tagging-autocomplete==0.3.1" "django-threadedcomments>=0.9" "django-userena" "hiredis>=0.1.0" httplib2 markdown "PIL>=1.1.7" "polib==0.6.3" pygooglechart pysolr "redis>=2.4.10" requests "South==0.7.3" "BeautifulSoup==3.2.0" "django-staticfiles==1.2.1" python-magic | |
pip install 'https://pypi.python.org/packages/source/d/django-filter/django-filter-0.5.1.tar.gz#md5=f28c24251ba108940ddc5b77a4ed829d' |
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
#Python 2 | |
python -m SimpleHTTPServer 8080 | |
#Python 3 | |
python3 -m http.server 8113 |
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
mkdir mozilla | |
hg init mozilla | |
cd mozilla | |
wget http://ftp.mozilla.org/pub/mozilla.org/firefox/bundles/mozilla-central.hg | |
hg unbundle mozilla-central.hg |
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
configurations { | |
apt | |
} | |
dependencies { | |
compile 'com.squareup.dagger:dagger:1.1.0' | |
apt 'com.squareup.dagger:dagger-compiler:1.1.0' | |
} | |
android.applicationVariants.all { variant -> |
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
// | |
// !!WARNING: Not recommended for production code!! | |
// | |
public class ClassLoaderActivity extends Activity | |
{ | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
// file.jar has a dex'd "classes.dex" entry that you can generate with "dx" from any number of JARs or class files | |
ClassLoader dexLoader = new DexClassLoader("/path/to/file.jar", getCacheDir().getAbsolutePath(), null, getClassLoader()); | |
setAPKClassLoader(dexLoader); |
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
public class Dexter { | |
private static String optimizedDirectory = "optimized"; | |
private static String workDirectory = "working"; | |
public static void loadFromAssets(Context context, String fileName) throws Exception { | |
File optimized = new File(optimizedDirectory); | |
optimized = context.getDir(optimized.toString(), Context.MODE_PRIVATE); | |
optimized = new File(optimized, fileName); |
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
/home/msk/Desktop/tb/comm-central/obj-x86_64-unknown-linux-gnu/mozilla/_virtualenv/bin/python -u /home/msk/Desktop/tb/comm-central/mozilla/config/pythonpath.py \ | |
-I./build \ | |
-I/home/msk/Desktop/tb/comm-central/mozilla/build \ | |
-I./_tests/mozbase/mozinfo \ | |
/home/msk/Desktop/tb/comm-central/mozilla/testing/xpcshell/runxpcshelltests.py \ | |
--manifest=./_tests/xpcshell/xpcshell.ini \ | |
--build-info-json=./mozinfo.json \ | |
--interactive \ | |
--test-plugin-path='dist/plugins' \ | |
--tests-root-dir=/home/msk/Desktop/tb/comm-central/obj-x86_64-unknown-linux-gnu/mozilla/_tests/xpcshell \ |
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 java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
import java.util.concurrent.ScheduledExecutorService; | |
import java.util.concurrent.TimeUnit; | |
public class CommonEventLoop { | |
private static CommonEventLoop __instance; | |
private ScheduledExecutorService m_executor = Executors.newSingleThreadScheduledExecutor(); |
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
private static String stripTokens(String log) { | |
if (HIDE_TOKENS) { | |
/* Common REGEX patterns for replacing tokens */ | |
log = log.replaceAll("token=\\S*", "token=ACCESS_TOKEN_REMOVED "); | |
log = log.replaceAll("client_secret=\\S*", "client_secret=CLIENT_SECRET_REMOVED "); | |
log = log.replaceAll("access_token=\\S*", "access_token=ACCESS_TOKEN_REMOVED "); | |
log = log.replaceAll("code=\\S*", "code=SOME_CODE_REMOVED "); | |
} | |
return log; | |
} |
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
#!/bin/bash | |
# Run this in the terminal and keep waiting for the response. | |
for i in `seq 1 1000000`; | |
do | |
echo $i | |
curl 'http://giphy.com/ajax/contest/vote' -H 'Cookie: __qca=P0-1475105941-1414474206710; _cb_ls=1; __asc=949617dd149553b8dfc7f2b22f2; __auc=949617dd149553b8dfc7f2b22f2; __utma=157163181.13407325.1414474207.1414474207.1414474207.1; __utmb=157163181.2.10.1414474207; __utmc=157163181; __utmz=157163181.1414474207.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _chartbeat2=851IKu1DUaBZ3vbj.1414474208673.1414474469947.1' -H 'X-NewRelic-ID: VwQBUlZWGwEAVlJSAwI=' -H 'Origin: http://giphy.com' -H 'Accept-Encoding: gzip,deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: */*' -H 'Referer: http://giphy.com/stickershop/sticker/a2FpeWVlLnRheUBnbWFpbC5jb20' -H 'X-CSRFToken: undefined' -H 'X-Requested- |
OlderNewer