Skip to content

Instantly share code, notes, and snippets.

View th3hunt's full-sized avatar
🎯
Focusing

Stratos Pavlakis th3hunt

🎯
Focusing
  • Blueground
  • Athens
View GitHub Profile
@th3hunt
th3hunt / xctest.swift
Last active January 11, 2016 18:06
An XCTest example
class MovieRamaInSwiftTests: XCTestCase {
let client = HttpClient.init()
let applicationManager = ApplicationManager.init()
func testExample() {
let expectation = expectationWithDescription("AlamofireGetMovies")
var searchResults : Array<MovieObj> = Array()
client.getMovieListForSearchText("She", limit: 7, currentPage: 1) { responseObject, error in
@th3hunt
th3hunt / .eslintrc
Created December 11, 2015 10:52
es6 eslint
{
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": false,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
@th3hunt
th3hunt / .gitconfig
Last active November 12, 2020 19:32
.gitconfig
[alias]
co = checkout
go = checkout -b
st = status
pr = pull --rebase
br = branch
filediff = diff --name-only
last = log -1 HEAD
fixup = commit --fixup
rebase-auto = git rebase --interactive --autosquash
@th3hunt
th3hunt / object-watch.js
Created November 7, 2015 10:09 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@th3hunt
th3hunt / .gitconfig
Created October 16, 2015 07:53
My new gitconfig
[alias]
co = checkout
go = checkout -b
st = status
pr = pull --rebase
br = branch
filediff = diff --name-only
last = log -1 HEAD
fixup = commit --fixup
@th3hunt
th3hunt / dashboard.js
Last active October 16, 2017 15:12
Chain PageObject methods with Intern.js, by having each PageObject instance using a new/enriched remote Command
define(function (require) {
var Page = require('./base/page')
, _ = require('vendor/lodash/lodash.underscore');
function DashboardPage() {
Page.apply(this, arguments);
}
DashboardPage.prototype = Object.create(Page.prototype);
@th3hunt
th3hunt / teaspoon.rb
Last active August 18, 2016 00:41
A teaspoon boot loader that works with browserify rails
# config/initializers/teaspoon.rb
module Teaspoon
module BootHelper
def create_browserify_bundle(suite)
bundle = File.join(Rails.root, 'tmp/javascripts', "suites/#{suite.name}.js")
bundle_dir = File.dirname(bundle)
FileUtils.mkdir_p(bundle_dir) unless File.directory?(bundle_dir)
specs = suite.spec_assets(false).map { |asset| "#{asset.gsub(/\.js.*$/, '')}" }
// helper to create proper asset paths if an asset host is configured
App.assets = {
assets : {
<% AssetsUtil.images.each do |img| %>
"<%= img %>" : "<%= asset_path(img) %>",
<% end %>
},
@th3hunt
th3hunt / extract_css3_rules.js
Created November 21, 2014 14:47
Extract CSS3 rules
var styleSheets = document.styleSheets
, len = styleSheets.length
, keyframeRules = [];
function extractKeyframes(styleSheet) {
var rules = styleSheet.rules;
rules.forEach = Array.prototype.forEach;
@th3hunt
th3hunt / ajaxSetup.js
Last active October 1, 2020 10:55
Global ajax handling skeleton
(function (App) {
/**
* Do before each Ajax request
* ---------------------------
*
* 1. Disable ajax related DOM controls to prevent double submissions
* 2. Extend each XHR object with a couple of methods that let ajax calls skip global handlers on-demand.
*
*/