Skip to content

Instantly share code, notes, and snippets.

View mightyhorst's full-sized avatar
🎯
Focusing

Nick Mitchell mightyhorst

🎯
Focusing
View GitHub Profile
<?php
/**
* A simple Facebook PHP example.
*
* - This is not a "Facebook SDK".
* - This example uses Curl, Hash, JSON, Session extensions.
* - This does not use the JavaScript SDK, nor the cookie set by it.
* - This works with Canvas, Page Tabs with IFrames, the Registration Plugin
* and with any other flow which uses the signed_request.
@mightyhorst
mightyhorst / dropzone-directive.js
Last active August 29, 2015 14:26 — forked from compact/dropzone-directive.js
AngularJS directive for Dropzone.js
/**
* An AngularJS directive for Dropzone.js, http://www.dropzonejs.com/
*
* Usage:
*
* <div ng-app="app" ng-controller="SomeCtrl">
* <button dropzone="dropzoneConfig">
* Drag and drop files here or click to upload
* </button>
* </div>
@mightyhorst
mightyhorst / angular-jqueryui-dnd.html
Created March 1, 2016 21:36 — forked from codef0rmer/angular-jqueryui-dnd.html
AngularJS + jQueryUI Drag & Drop
<!DOCTYPE html>
<html ng-app="App">
<head>
<meta name="description" content="AngularJS + jQuery UI Drag-n-Drop" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<meta charset=utf-8 />
@mightyhorst
mightyhorst / inject-jquery.js
Created March 15, 2018 00:40 — forked from tad-lispy/inject-jquery.js
Inject jQuery into webpage via console (oneliner)
document.getElementsByTagName('head')[0].appendChild(document.createElement('script')).src = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'
@mightyhorst
mightyhorst / class_decorator.ts
Created September 6, 2018 08:27 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@mightyhorst
mightyhorst / README.md
Created October 6, 2018 07:06 — forked from xaviervia/README.md
Sketch 43 files JSON types
@mightyhorst
mightyhorst / is_installed.sh
Created March 4, 2019 05:57 — forked from JamieMason/is_installed.sh
Check if a program exists from a bash script.Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@mightyhorst
mightyhorst / keycloak.sh
Created April 19, 2019 01:57 — forked from luciddreamz/keycloak.sh
Keycloak Admin API Rest Example: Get User
#!/bin/bash
# requires https://stedolan.github.io/jq/download/
# config
KEYCLOAK_URL=http://localhost:8080/auth
KEYCLOAK_REALM=realm
KEYCLOAK_CLIENT_ID=clientId
KEYCLOAK_CLIENT_SECRET=clientSecret
USER_ID=userId
@mightyhorst
mightyhorst / bitbucket-pipelines.yml
Created October 9, 2019 03:19 — forked from jincod/bitbucket-pipelines.yml
Docker deployment using Bitbucket Pipelines and Heroku
pipelines:
default:
- step:
name: build and publish docker image
services:
- docker
caches:
- docker
script:
- docker build -t $APP_NAME .