Skip to content

Instantly share code, notes, and snippets.

View preslavrachev's full-sized avatar

Preslav Rachev preslavrachev

View GitHub Profile
@preslavrachev
preslavrachev / facebookService.java
Created May 8, 2013 12:37
How to submit a FQL query to Facebook on Android (thanks to http://stackoverflow.com/a/13163261/1107412)
String fqlQuery = "select uid, name, pic_square, is_app_user from user where uid in (select uid2 from friend where uid1 = me())";
Bundle params = new Bundle();
params.putString("q", fqlQuery);
Session session = Session.getActiveSession();
Request request = new Request(session,
"/fql",
params,
HttpMethod.GET,
new Request.Callback(){
@preslavrachev
preslavrachev / UploaderServlet.java
Created May 15, 2013 08:08
Handling an Uploadify file upload with a servlet (thanks to http://stackoverflow.com/a/2273711/1107412)
package com.example;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
#!/bin/sh
# Download Neko
curl -L http://nekovm.org/_media/neko-2.0.0-osx.tar.gz > neko-2.0.0-osx.tar.gz
# Extract and copy files to /usr/lib/neko
<?php
/* Merge multiple RSS feeds with SimplePie
*
* Just modify the path to SimplePie and
* modify the $feeds array with the feeds you want
*
* You should probably also change the channel title, link and description,
* plus I added a CC license you may not want
*
* Help from: http://www.webmaster-source.com/2007/08/06/merging-rss-feeds-with-simplepie/
@preslavrachev
preslavrachev / AppManifest.xml
Created September 4, 2013 15:03
Create a custom application class by subclassing the default Application class. According to the Android documentation, this is not a preferred way, as the Android guys consider a singleton with an access to an app-level Context a more modular approach. Nevertheless, it is worth knowing how to do it.
<application
android:name="com.you.yourapp.CustomApplication"
package com.aaplab.android.robird.utils;
import android.app.ActivityManager;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;

Sexy transition between Activities (based on Twitter transition)

Looking at the officiel Twitter Android client I've noticed the slight cool & sexy transition between activities. I was curious to know how that worked so I had fun with android xml animations and ended up with that:

push_left_in.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
#!/usr/bin/env python
"""
Decrypting proxy for Snapchat
Based on mitmproxy + pysnap
https://github.com/mitmproxy/mitmproxy
https://github.com/martinp/pysnap
"""
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.core.CoreContainer;
@preslavrachev
preslavrachev / app.js
Last active July 11, 2017 15:48
Integrating browserify into an Ionic project
var customModule = require('./custom-module');
var app = angular.module('myApp', ['ionic']);
...