Skip to content

Instantly share code, notes, and snippets.

import os.path, sys, os, SimpleHTTPServer, SocketServer, clipboard, webbrowser, shutil, zipfile, console
__mega_acct__ = 'yourname@example.com'
__mega_pass__ = 'passwordhere'
def _unzip(a_zip=None, path='.', altpath='unzipped'):
if a_zip is None:
return
filename = os.path.abspath(a_zip)
if not os.path.isfile(filename):
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@pjobson
pjobson / remove_mcafee.md
Last active March 26, 2024 04:26
OSX McAfee Removal

Removal of McAfee from OSX

Note: This was written in 2015, it may be out of date now.

There are a lot of commands here which I use sudo if you don't know what you're doing with sudo, especially where I rm you can severely screw up your system.

There are many reasons which you would want to remove a piece of software such as McAfee, such as not wanting it to hammer your CPU during work hours which seems like primetime for a virus scan.

I intend this to be a living document, I have included suggestions from peoples' replies.

@richardleggett
richardleggett / CustomMediaController.java
Created April 24, 2014 12:36
Custom MediaController that fixes issue with controls appearing offset on pre 4.3 devices and shows how to add additional functionality such as fullscreen button
package com.app.video.ui;
import android.content.Context;
import android.os.Build;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.FrameLayout;
@epb-644
epb-644 / rxFIZZBUZZ
Created June 13, 2014 17:48
rxjava version of FIZZBUZZ
import rx.Observable;
import rx.observables.ConnectableObservable;
public class RxFizzBuzz {
public static void main(String[] args) {
final ConnectableObservable<Integer> range = Observable.range(1, 100).publish();
final Observable<String> out = Observable.merge(
range.filter((n) -> n % 15 == 0).map((n) -> "FIZZBUZZ"),
range.filter((n) -> n % 15 != 0 && n % 3 == 0).map((n) -> "FIZZ"),
@alexfu
alexfu / DividerItemDecoration.java
Last active February 9, 2023 05:09
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Shywim
Shywim / CursorRecyclerAdapter.java
Last active February 27, 2024 13:42
A custom Adapter for the new RecyclerView, behaving like the CursorAdapter class from previous ListView and alike. Now with Filters and updated doc.
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matthieu Harlé
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@skyfishjy
skyfishjy / CursorRecyclerViewAdapter.java
Last active December 16, 2023 08:55
CursorRecyclerViewAdapter
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@delor
delor / build.gradle
Created November 21, 2014 20:57
Gradle task for generating Maven's POM file for Android AAR
task createPom {
apply plugin: 'maven'
description "Generates pom.xml"
pom {
project {
groupId 'com.example'
artifactId 'example'
version '0.0.1-SNAPSHOT'
packaging 'aar'
}
@da667
da667 / gist:fc2a311803415740927e
Created December 9, 2014 15:28
simple analysis script - now with less CPU grinding.
#!/bin/bash
#analysis script
#goal: for each file that isn't a rar, tar, gz, txt, reg, bat or sh:
#make a directory, copy the malware into the directory, cd into the directory, run hashing tools, file, strings dump into file (separate file for strings output, because its obnoxiously long in most cases) go back to parent directory, rinse, repeat until done.
#also stores a hash file for each hash type done in one single master file in the parent directory (e.g. all_md5.txt, all_ssdeep.txt, etc.)
for i in `ls -1 | egrep -v "sh|bat|rar|tar|gz|txt|reg"`; do
filedir=`echo $i`_analysis
filetxt=`echo $i`_analysis.txt
filestr=`echo $i`_strings.txt
mkdir -p $filedir