Skip to content

Instantly share code, notes, and snippets.

View taylorstine's full-sized avatar

Taylor Stine taylorstine

  • Carnegie Mellon
  • Pittsburgh
View GitHub Profile
@taylorstine
taylorstine / gist:6273011
Created August 19, 2013 19:27
Shell script to download GLEW
mkdir ~/Glew
cd ~/Glew
wget https://sourceforge.net/projects/glew/files/glew/1.9.0/glew-1.9.0.tgz
wget https://nvidia-texture-tools.googlecode.com/svn-history/r96/trunk/cmake/FindGLEW.cmake
mv FindGLEW.cmake /usr/share/cmake-2.8/Modules/
tar -xvf glew-1.9.0.tgz
cd ./glew-1.9.0/
sudo make
cd ~
rm -r ~/Glew
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
@taylorstine
taylorstine / android_screencapture
Created December 10, 2013 14:50
These are two commands to capture a video of your android device (up to 3 minutes). As seen on http://www.youtube.com/watch?v=6QHkv-bSlds#t=1389. This only works with Kit Kat or higher.
adb shell screenrecord /sdcard/my_video.mp4
adb pull /sdcard/my_video.mp4
@taylorstine
taylorstine / MainActivity.java
Created December 11, 2013 17:16
Scanner implememtation for Pic2Scan
/**
* on click listener for the scan button
* @param v view that was clicked
*/
@OnClick(R.id.scan_wrapper_button)
public void onScanClick(View v){
Analytics.trackAction("Scan", null);
togglePressed((ImageButton) findViewById(R.id.scan_button));
Intent intent = new Intent( PIC2SHOP_PACKAGE );
@taylorstine
taylorstine / build.gradle
Created December 20, 2013 20:34
for signing
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
#!/bin/sh
mkdir ~/Dev
cd ~/Dev
echo $'export DEV_HOME="$HOME/Dev"' >>~/.bash_profile
wget http://www.interior-dsgn.com/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
tar -xvf apache-maven-3.0.5-bin.tar.gz
echo $'export MAVEN_HOME="$DEV_HOME/apache-maven-*/bin"\nPATH="$PATH:$(echo $MAVEN_HOME)"' >> ~/.bash_profile
rm apache-maven-3.0.5-bin.tar.gz
@taylorstine
taylorstine / gist:8439445
Created January 15, 2014 16:32
Shows the difference between a CharSequence and a string.
ackage com.tstine.practice2;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
@taylorstine
taylorstine / send-email.js
Last active February 17, 2016 15:21
emailSender function for parse-server
import aws from 'aws-sdk'
import path from 'path'
import fs from 'fs'
aws.config.loadFromPath(path.resolve('credentials', 'aws_config.json'));
const ses = new aws.SES({apiVersion: '2010-12-01'});
const resetEmail = fs.readFileSync(path.resolve('emails', 'reset-password.html'), 'utf8');
const verifyEmail = fs.readFileSync(path.resolve('emails', 'verify-email.html'), 'utf8');
import {Constants} from 'parse-server'
import Promise from 'bluebird'
@taylorstine
taylorstine / configure.js
Last active April 21, 2016 09:31
Mailgun config
import {ParseServer} from 'parse-server'
const parseApi = new ParseServer({
mailConfig: {
service: 'mailgun',
apiKey: 'key-MAILGUNKEY',
domain:'DOMAIN.mailgun.org',
fromAddress:'MY App <mailgun@MY_APP_DOMAIN>'
},
...parseParams
});
@taylorstine
taylorstine / send-email.js
Last active April 14, 2016 16:22
Mailadapter implementation
function SESAdapter(appId, mailApiConfig) {
this.appId = appId;
this.apiConfig = mailApiConfig;
}
SESAdapter.prototype.sendMail = function(to, subject, body) {
return new Promise((resolve, reject)=>{
ses.sendEmail({
Source: 'contact@MYAPP.DOMAIN',
Destination: {