Skip to content

Instantly share code, notes, and snippets.

@wickdninja
wickdninja / http.js
Last active February 6, 2019 10:16
jQuery HTTP json service with promises
var Http = (function ($, storage, self) {
var _contentType = 'application/json; charset=utf-8',
_dataType = 'json',
_key = 'token';
function getToken() {
return storage.getItem(_key);
}
function setAuthHeader(xhr) {
@wickdninja
wickdninja / scrape-pr-for-jira.js
Last active May 8, 2017 14:19
Scrape PR page for list of JIRA tickets
/* jshint esversion:6*/
class Scraper {
constructor(keys) {
this.count = 0;
this.output = '\n\n';
this.keys = keys;
}
scrape() {
@wickdninja
wickdninja / commit-msg
Created March 23, 2017 13:10
Require Jira Ticket in commit message
#!/bin/sh
# Require Jira Ticket in commit message
KEY="ABP-"
WARNING="Jira ticket reference NOT FOUND but is required!"
MESSAGE=$(<$1)
case "$MESSAGE" in
$KEY*)
exit 0;
;;
span>{{model.amount | currency:'USD':true:'1.2-2'}}</span>
@wickdninja
wickdninja / .gitconfig
Last active June 20, 2023 15:37 — forked from robmiller/.gitconfig
My git config
[user]
name = TODO
email = TODO
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
@wickdninja
wickdninja / FileManager.swift
Created September 10, 2015 18:15
file access swift 1.2
//
// FileManager.swift
// picturepay
//
// Created by Nate on 3/3/15.
// Copyright (c) 2015 alliedpayment. All rights reserved.
//
import Foundation
@wickdninja
wickdninja / search.swift
Created July 31, 2015 23:38
Swift Search Snippets
var resultSearchController = UISearchController()
self.resultSearchController = ({
let controller = UISearchController(searchResultsController: nil)
controller.dimsBackgroundDuringPresentation = false
controller.hidesNavigationBarDuringPresentation = true
controller.searchBar.sizeToFit()
self.navigationController?.view = controller.searchBar
self.tableView.contentOffset = CGPointMake(0, CGRectGetHeight(controller.searchBar.frame));
return controller
/*
Converts A class to a dictionary, used for serializing dictionaries to JSON
Supported objects:
- Serializable derived classes
- Arrays of Serializable
- NSData
- String, Numeric, and all other NSJSONSerialization supported objects