This file contains 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
import { Directive } from '@angular/core'; | |
@Directive({ | |
selector: 'video' | |
}) | |
export class AutoplayVideoDirective { } |
This file contains 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
import {Directive} from '@angular/core'; | |
/* | |
* This is technically a directive | |
* but we have to treat it like a provider to be able to manipulate it directly. | |
* So it must be imported into our app.module as a provider, instead of a directive. | |
* | |
* The reason I'm keeping it as a directive, instead of a service provider, is because it interacts with the DOM | |
* and not any data retrial / presentation, even though it's imported as one...weird I know. | |
* |
This file contains 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
# This removes the unsupported archetypes from frameworks on the build phase. | |
echo "Target architectures: $ARCHS" | |
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" | |
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK | |
do | |
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) | |
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" | |
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" |
This file contains 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
# Credits : Jason Horwitz, https://github.com/sekati | |
# Aashish Tamsya, [email protected] | |
# | |
# | |
# BuildVersion.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script |
This file contains 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
# Credits : Jason Horwitz, https://github.com/sekati | |
# Aashish Tamsya, [email protected] | |
# | |
# | |
# VersionNumberIncrement.sh | |
# @desc Auto-increment the version number (only) when a project is archived for export. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script |
This file contains 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
getDiff() { | |
function changes(object, base) { | |
let arrayIndexCounter = 0; | |
return _.transform(object, function (result, value, key) { | |
if (!_.isEqual(value, base[key])) { | |
let resultKey = _.isArray(base) ? arrayIndexCounter++ : key; | |
result[resultKey] = (_.isObject(value) && _.isObject(base[key])) ? changes(value, base[key]) : value; | |
console.log("Result: " + JSON.stringify(result)); | |
} | |
}); |
This file contains 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 getFiles(dir: string, fileList?: []) { | |
let files = fs.readdirSync(dir); | |
fileList = fileList || []; | |
files.forEach(async (file) => { | |
if(fs.statSync(dir + file).isDirectory()) { | |
// @ts-ignore | |
fileList = await getFiles(dir + file + '/', fileList); | |
} else { | |
// @ts-ignore | |
fileList.push( dir + '/' + file); |
This file contains 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
import * as _ from 'lodash'; | |
... | |
/* | |
* Group them by the formatted date below. | |
* The more specific this format is, the smaller the groups will become. | |
*/ | |
private groupMessagesByDate(messages) { | |
return _(messages) | |
.groupBy((m: any) => m.date.format('MM/DD/YYYY')) |
This file contains 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
@mixin aspectRatio($ratio: '1:1', $width: 100%) { | |
width: $width; | |
@if($ratio == '1:1') { | |
padding-top: 100%; /* 1:1 Aspect Ratio */ | |
} | |
@else if($ratio == '16:9') { | |
padding-top: 56.25%; /* 16:9 Aspect Ratio */ | |
} | |
@else if($ratio == '4:3') { | |
padding-top: 75%; /* 4:3 Aspect Ratio */ |
This file contains 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
@mixin scrollInText() { | |
overflow: initial !important; | |
} |
OlderNewer