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
describe('when swiping the gallery', () => { | |
it('should send analytics of how far the user has swiped', () => { | |
spyOn(AnalyticsService, 'sendEvent'); | |
swipe(); | |
expect(AnalyticsService.sendEvent()) | |
.toHaveBeenCalledWith('gallery', 'swiped', 'right', 99); | |
}); | |
}); |
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
/* | |
Dynamic spacing classes | |
Spacers that grow and shrink based off ratios between the breakpoints | |
Margins: | |
<div class="m-top-sm m-right-md m-bottom-sm m-left-md">...</div> | |
<div class="m-sm">...</div> | |
Padding: | |
<div class="p-top-sm p-right-md p-bottop-sm p-left-md">...</div> |
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
/* Color palette */ | |
$colors: ( | |
white-1: #fff, | |
black-1: #000, | |
grey-1: #eee, | |
grey-2: #ccc, | |
blue-1: #69d2e7, | |
blue-2: #a7dbd8, | |
red-1: #e82d27, | |
red-2: #d82023, |
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
SELECT SUBSTRING_INDEX( `field_name` , ' ', 1 ) AS `field_name_first_word` | |
FROM `table_name` | |
ORDER BY LENGTH(`field_name_first_word`) desc; |
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
/* | |
* Converts ASCII string to an Int where plausible | |
* @param {String} str the string passed to atoi | |
* return {Int?} the converted integer value | |
*/ | |
func atoi(str: String) -> Int? { | |
// Trim trailing whitespace | |
var newStr:String = str.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet()) |
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
'ListFilesInDirectory | |
'Lists all files of specific criteria (e.g., '*.pdf') in certain folder | |
Sub ListFilesInDirectory() | |
On Error GoTo ErrHandler | |
Dim sFilename As String, sPath As String | |
Dim fsFile, fsFileProps As Object | |
Dim sProceed As Integer | |
Dim i As Long |
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
/* Tested with jquery-1.7.2.min.js */ | |
$(window).load(function () { | |
"use strict"; | |
/* Cycles XML file on successful load via ajax and parses contents into HTML */ | |
function parseXML(xml) { | |
/* Variable declaration */ | |
var outHTML = "", employee, sId, sFirstname, sSurname, sAddress; |
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
Function WorksheetExists(wsName As String) As Boolean | |
Dim ws As Worksheet | |
Dim found As Boolean | |
found = False | |
wsName = UCase(wsName) | |
For Each ws In ThisWorkbook.Sheets | |
If UCase(ws.Name) = wsName Then |
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
'RefreshODBCLinks() | |
'Refreshes the ODBC links to ensure the latest data is being pulled through and is correct | |
Function RefreshODBCLinks() As Boolean | |
Dim sConnStr As String | |
sConnStr = "ODBC;" _ | |
& "DATABASE={Database Name e.g., theDatabase};" _ | |
& "DSN={ODBC Connection Name e.g., theDB};" _ | |
& "LANGUAGE={Lanauge of Database e.g., British};" _ | |
& "DRIVER={SQL Version e.g., SQL Server Native Client 10.0};" _ |
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
'Global Error Varibles | |
Public bDisplayError As Boolean | |
Public sProcName, sDetails As String | |
Public iErrorCount As Integer | |
Public Function bCentralErrorHandler(ByVal sModule$, ByVal sSub$, ByVal sDetails$) As Boolean | |
'Make sure there is no errors in the Error Handling system | |
On Error Resume Next |
NewerOlder