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 PIL import Image | |
import os | |
import glob | |
import numpy as np | |
def crop(im, height, width): | |
# im = Image.open(infile) | |
imgwidth, imgheight = im.size | |
rows = np.int(imgheight/height) |
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
/* SF OAuth request, redirect to SF login */ | |
app.get('/oauth/auth', function(req, res) { | |
res.redirect(oauth2.getAuthorizationUrl({scope: 'api id web'})); | |
}); | |
/* OAuth callback from SF, pass received auth code and get access token */ | |
app.get('/oauth/callback', function(req, res) { | |
var conn = new jsforce.Connection({oauth2: oauth2}); | |
var code = req.query.code; | |
conn.authorize(code, function(err, userInfo) { |
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
import org.apache.commons.pool.impl.GenericObjectPool.Config; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.data.redis.connection.lettuce.DefaultLettucePool; | |
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; | |
import org.springframework.data.redis.core.StringRedisTemplate; | |
import org.springframework.stereotype.Component; | |
@Component | |
public class LettuceRedisClientConnectionPooling { |
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 class InputfieldDemoController { | |
//Variable under test | |
public String valuefromJS {get; set;} | |
public pagereference someMethod(){ | |
System.debug(valuefromJS); | |
return 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
package com.appspot.dangt85.controllers; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URLEncoder; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
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
# Example code to demonstrate parallel for loop implementation using joblib | |
from joblib import Parallel, delayed | |
import multiprocessing | |
# Vars | |
my_list = range(10) | |
squares = [] | |
# Function to parallelize | |
def find_square(i): |
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
#!/usr/bin/env python | |
import sys | |
import json | |
from boto.s3.connection import S3Connection | |
from boto.s3.prefix import Prefix | |
from boto.s3.key import Key | |
bucketname = sys.argv[1] | |
delimiter = '/' |
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
/* SF OAuth request, redirect to SF login */ | |
app.get('/oauth/auth', function(req, res) { | |
res.redirect(oauth2.getAuthorizationUrl({scope: 'api id web'})); | |
}); | |
/* OAuth callback from SF, pass received auth code and get access token */ | |
app.get('/oauth/callback', function(req, res) { | |
var conn = new jsforce.Connection({oauth2: oauth2}); | |
var code = req.query.code; | |
conn.authorize(code, function(err, userInfo) { |
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
consumer_key = 'your-consumer-key' | |
consumer_secret = 'your-consumer-secret' | |
access_token = 'your-access-token' | |
access_secret = 'your-access-secret' |
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
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |