Skip to content

Instantly share code, notes, and snippets.

View schalkneethling's full-sized avatar
🇺🇦
The world wants peace, not war ✌️

Schalk Neethling schalkneethling

🇺🇦
The world wants peace, not war ✌️
View GitHub Profile
@schalkneethling
schalkneethling / keybase.md
Created February 17, 2015 19:05
keybase.md

Keybase proof

I hereby claim:

  • I am schalkneethling on github.
  • I am schalkneethling (https://keybase.io/schalkneethling) on keybase.
  • I have a public key whose fingerprint is CEC2 47D4 C5F6 E836 D058 9FC7 F4CF EA0E 884A C5F4

To claim this, I am signing this object:

@schalkneethling
schalkneethling / casperjs-snippets.cson
Last active August 29, 2015 14:23
Useful Casperjs snippets
".source.js":
"Casperjs Skeleton":
"prefix": "casper-init"
"body": """
/* This Source Code Form is subject to the terms of the Mozilla Public" + '/n' +
"* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* global casper */
'use strict';
@schalkneethling
schalkneethling / inArray.js
Last active August 29, 2015 14:24
Find if an item is in an array and return it's index or -1 if not found
/* Returns either the index of the location in the array,
or -1 if the array did not contain the targetValue,
using a binary seach algorithm */
var inArray = function(array, targetValue) {
var min = 0;
var max = array.length - 1;
var guess;
while(max >= min) {
@schalkneethling
schalkneethling / karma.conf.js
Created July 7, 2015 16:30
Sample Karmajs config file
module.exports = function(config) {
config.set({
// Karma configuration
// base path, that will be used to resolve files and exclude
basePath: '../../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
@schalkneethling
schalkneethling / simple-snippet.html
Created September 22, 2015 15:59
Simple Snippet Updated
<style>
#snippetContainer div.snippet img.icon {
float: none;
margin: 0;
}
.snippet p {
display: inline-block;
padding-left: 0;
@schalkneethling
schalkneethling / tasks.json
Created November 13, 2015 09:24
Sample JSON data format for tasks list on contribute page
[
{
"id": "1",
"name": "Download Whimsy",
"description": "Personalize your Fox, install an Add-On.",
"steps": [
"Download Whimsy",
"Open a New Tab"
],
"simple": "true",
@schalkneethling
schalkneethling / UserAgent.txt
Last active November 15, 2015 17:03
A growing list of userAgent strings
UserAgent Strings
IE9 on Windows 7
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
IE10 on Windows 7
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
IE11 on Windows 8.1
Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko
@schalkneethling
schalkneethling / ajax-jasmine.js
Last active December 16, 2015 13:39
Intercept and mock Ajax calls with Jasmine-Ajax
/* For reference read the Jasmine and Sinon docs
* Jasmine docs: http://pivotal.github.io/jasmine/
*/
/* global describe, beforeEach, afterEach, it, expect */
describe('ajax.js', function() {
'use strict';
(function() {
'use strict';
var $statusUnknown = $('.status-unknown');
var $tab = $('caption', $statusUnknown);
var $tabPanels = $('thead, tbody', $statusUnknown);
var expandedState;
$tab.on('click', function() {
@schalkneethling
schalkneethling / sidebar-sizer.js
Created May 16, 2016 15:08
How to set the size of a built in Sidebar element in Firefox add-ons
var activeWindow = utils.getMostRecentBrowserWindow();
var _sidebar = activeWindow.document.getElementById('sidebar');
_sidebar.style.width = '320px';
_sidebar.style.maxWidth = '320px';