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
| // ==UserScript== | |
| // @name GPlus go to circle | |
| // @namespace http://dafigplus/ | |
| // @version 0.1 | |
| // @description Change links on google and google plus to go on specific circle | |
| // @match http://*google* | |
| // @match https://*google* | |
| // @copyright 2012+, You | |
| // ==/UserScript== | |
| var defaultCircleUrl = 'https://plus.google.com/u/0/stream/circles/p21da507289aa9fa1'; |
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
| // From http://stackoverflow.com/questions/9960908/permutations-in-javascript | |
| var permArr = [], | |
| usedChars = []; | |
| function permute(input) { | |
| var i, ch; | |
| for (i = 0; i < input.length; i++) { | |
| ch = input.splice(i, 1)[0]; | |
| usedChars.push(ch); |
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
| gource -1920x1080 --title "MyTitle" --hide filenames --stop-at-end --file-idle-time 0 -o temporary.ppm --seconds-per-day .00050 ~/prj/svn/myproject | |
| ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i temporary.ppm -vcodec libx264 -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 -preset slow finalVideo.mp4 |
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
| var fs = require('fs'); | |
| var androidManifest = fs.readFileSync("AndroidManifest.xml", 'utf-8'); | |
| var m = androidManifest.match(/android:versionCode="([0-9]+)"/); | |
| if (m) { | |
| var versionCode = parseInt(m[1], 10) + 1; | |
| var updatedAndroidManifest = androidManifest.replace(/(android:versionCode=")([0-9]+)(")/, '$1' + versionCode + '$3'); | |
| fs.writeFileSync("AndroidManifest.xml", updatedAndroidManifest, 'utf-8'); | |
| console.log('Updated versionCode to ' + versionCode); |
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
| # Install virtualbox | |
| cd /etc/yum.repos.d/ | |
| wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo | |
| sudo yum update | |
| sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
| sudo yum -y install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms | |
| sudo yum -y install VirtualBox-4.2 |
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
| public static String getRealPathFromImageURI(Context context, Uri contentUri) { | |
| Cursor cursor = null; | |
| try { | |
| String[] proj = { MediaStore.Images.Media.DATA }; | |
| cursor = context.getContentResolver().query(contentUri, proj, null, null, null); | |
| int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); | |
| cursor.moveToFirst(); | |
| return cursor.getString(column_index); | |
| } finally { | |
| if (cursor != null) { |
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
| public void updateSingleRow(int position) | |
| { | |
| if (position >= listView.getFirstVisiblePosition() && position < listView.getLastVisiblePosition()) | |
| { | |
| View v = ((ViewGroup) listView.getChildAt(listView.getHeaderViewsCount() + (position - listView.getFirstVisiblePosition()))) | |
| .getChildAt(0); | |
| adapter.getView(position, v, listView); | |
| } | |
| } |
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
| package com.ternaryop.phototumblrshare.widget; | |
| import android.content.Context; | |
| import android.util.AttributeSet; | |
| import android.view.MotionEvent; | |
| import android.view.View; | |
| import android.view.View.OnTouchListener; | |
| import android.widget.TextView; | |
| public class ClickableTextView extends TextView implements OnTouchListener { |