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 AWS = require('aws-sdk'); | |
AWS.config.region = 'your aws region'; | |
AWS.config.update({ | |
accessKeyId: "your access id", | |
secretAccessKey: "your secret access key", | |
}); | |
var sns = new AWS.SNS(); | |
var params = { |
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
/** | |
* This gist was inspired by the video course titled "Building React Applications with Idiomatic Redux" | |
* available on Egghead.io by the creator of Redux, Dan Abramov. | |
* | |
* The purpose of this gist is to demonstrate general purpose reducers that can be used via Redux's combineReducers | |
* to compose more complex reducers and therefore maximize code reuse. | |
* | |
* Feedback is more than welcome! | |
* | |
* @author Christoffer Niska <[email protected]> |
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
{ | |
"lambda": { | |
"envVars": [], | |
"deploy": false, | |
"package": { | |
"optimize": { | |
"builder": "browserify", | |
"minify": true, | |
"ignore": [], | |
"exclude": [ |
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
/* This is intentionally blank just and exists to secure a decent gist name */ |
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 { connect } from 'react-redux'; | |
import { createSelectorCreator } from 'reselect'; | |
import { reduxForm } from 'redux-form'; | |
function memoize(func, equalityCheck = (a, b) => a === b) { | |
const lastArgsCache = {}; | |
const lastResultCache = {}; | |
return (...args) => { | |
const memoizeKey = args.pop(); | |
const lastArgs = lastArgsCache[memoizeKey]; |
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://www.tuaw.com/2011/03/14/use-applescript-to-open-current-safari-url-in-google-chrome/ | |
-- install FastScripts http://www.red-sweater.com/fastscripts/ and place this AppleScript in the Scripts applications folder for Google Chrome. | |
-- For me that was ~/Library/Scripts/Applications/Safari | |
-- You can then assign it a keyboard shortcut. I went with Cmd-Shift-C | |
property theURL : "" | |
tell application "Safari" | |
set theURL to URL of current tab of window 1 | |
end tell | |
tell application "Google Chrome" |
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
-- Open URL of currently active Google Chrome tab in Firefox | |
-- | |
-- Open Automator -> Service. | |
-- At the top, select "no input" and Google Chrome. | |
-- Find "Run AppleScript" in the library, and drag it to the right. | |
-- Paste this code in the textbox. | |
-- Save this script as "Open in Firefox". | |
-- Open System Preferences -> Keyboard -> Keyboard Shortcuts -> Services. | |
-- Assign a shortcut to "Open in Firefox". |
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
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
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 strict'; | |
// Adapted from https://github.com/ColCh/jest-webpack/blob/f8e02b7a51da48c55395392e61d9c03789e43911/preprocessor.js | |
// Packages these tests with deps with webpack https://github.com/ninjapanzer/Backbone-Flux-React-Webpack/tree/master/__tests__ | |
var webpack = require('webpack'); | |
var MemoryFileSystem = require('memory-fs'); | |
var fs = new MemoryFileSystem(); |
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
class UtilityController extends BaseController { | |
public function upload() | |
{ | |
$file = Input::file('Filedata'); | |
$name = Date("now").'-'.$file->getClientOriginalName(); | |
$uploadSuccess = $file->move(public_path().'/uploads',$name); | |
if( $uploadSuccess ) { | |
return Response::json(array( | |
"status"=>"200", |