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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body onload="bodyOnload();"> | |
</body> | |
</html> |
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
angular.module('ng').filter('tel', function () { | |
return function (tel) { | |
if (!tel) { return ''; } | |
var value = tel.toString().trim().replace(/^\+/, ''); | |
if (value.match(/[^0-9]/)) { | |
return tel; | |
} |
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
<?php | |
class Blog extends Eloquent | |
{ | |
public function images() | |
{ | |
return $this->has_many_and_belongs_to('Image') | |
->order_by('blog_image.id', 'asc'); | |
} | |
} |
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
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/ | |
/*At least requires the meta viewport tag with content 'width=device-width'*/ | |
@media only screen and (max-width: 1080px) and (orientation : portrait) { | |
/* PORTRAIT: | |
Windows Surface Pro*/ | |
} | |
@media only screen and (max-width: 800px) and (orientation : portrait) { | |
/* PORTRAIT: | |
Acer Iconia Tab A100 |
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
# CoffeeScript directive to focus an element when a property changes | |
# Thanks to: http://stackoverflow.com/questions/14833326/how-to-set-focus-in-angularjs | |
masterApp.directive "takeFocus", ["$timeout", "$parse", ($timeout, $parse) -> | |
link: (scope, element, attrs) -> | |
model = $parse(attrs.takeFocus) | |
scope.$watch model, (value) -> | |
if value is true | |
$timeout -> | |
element[0].focus() |
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
$scope.openModalImage = function (imageSrc, imageDescription) { | |
$modal.open({ | |
templateUrl: "path/to/modalImage.html", | |
resolve: { | |
imageSrcToUse: function () { | |
return imageSrc; | |
}, | |
imageDescriptionToUse: function () { | |
return imageDescription; | |
} |
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
package main | |
type verbosityEnum int | |
const ( | |
NoneVerbosity verbosityEnum = 1 << iota | |
ErrorVerbosity verbosityEnum = 2 | |
WarningVerbosity verbosityEnum = 4 | |
InfoVerbosity verbosityEnum = 8 | |
AllVerbosity verbosityEnum = 16 |
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
package main | |
//Thanks to http://ecs.victoria.ac.nz/foswiki/pub/Main/TechnicalReportSeries/ECSTR11-01.pdf | |
import ( | |
"fmt" | |
) | |
//We will have multiple car parts | |
type CarPart interface { | |
Accept(CarPartVisitor) |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
) | |
func main() ([]string, error) { | |
searchDir := "c:/path/to/dir" |
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
:: | |
:: Thanks to: https://stackoverflow.com/questions/19832669/inserting-date-time-stamp-in-file-name-using-bat-script/19835038#19835038 | |
:: | |
@echo off | |
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" | |
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%" | |
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%" | |
set "datestamp=%YYYY%%MM%%DD%" & set "timestamp=%HH%%Min%%Sec%" |
OlderNewer