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 | |
/** @var \Illuminate\View\Compilers\BladeCompiler $bladeCompiler */ | |
$bladeCompiler->directive('markdown', function () { | |
return "<?php echo(\Illuminate\Support\Str::markdown(<<<HEREDOC"; | |
}); | |
$bladeCompiler->directive('endmarkdown', function () { | |
return "HEREDOC)); ?>"; |
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
import { Router } from 'express'; | |
const group = ((callback: (router: Router) => void) => { | |
const router = Router(); | |
callback(router); | |
return router; | |
}); | |
export default group; |
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
import { Subject } from 'rxjs'; | |
import { debounceTime } from 'rxjs/operators'; | |
export function Debounce(time: number) { | |
return function ( | |
target: any, | |
propertyKey: string, | |
descriptor: PropertyDescriptor | |
) { | |
const originalMethod = descriptor.value; |
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
dpkg-deb -x <app>.deb temp | |
dpkg-deb --control <app>.deb | |
mv DEBIAN/ temp/ | |
sed -ie 's/libappindicator3-1/libayatana-appindicator3-1/' temp/DEBIAN/control | |
dpkg -b temp <app>-fixed.deb | |
sudo apt install ./<app>-fixed.deb | |
rm -rf temp |
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
export const mapNested = (nodes: any, mapCallback: any) => { | |
function recursive(nodes: any) { | |
return nodes.map((node: any) => { | |
return recursiveSelector(node, recursive, mapCallback) | |
}); | |
} | |
return recursive(nodes); | |
} | |
const recursiveSelector = (node: any, recursive: any, map: any) => { |
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
export const formatNested = function (flatArray: any[], id: any, parentId: any): Array<any> { | |
const collection: Array<any> = []; | |
flatArray.forEach((item) => (collection[item[id]] = { ...item, children: [] })); | |
const result: Array<any> = []; | |
flatArray.forEach((item) => { | |
if (item[parentId]) { | |
if (collection[item[parentId]]) { | |
collection[item[parentId]].children.push(collection[item[id]]); | |
} | |
} else { |
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
export const asyncForEach = async function (array: Array<any>, callback: any) { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array); | |
} | |
}; | |
// await asyncForEach(collection, async (item) => { await doSomething(item); }); |
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
import { Injectable } from '@angular/core'; | |
import { HttpClient, HttpHeaders } from '@angular/common/http'; | |
import { Observable } from 'rxjs'; | |
import { environment } from '@env/environment'; | |
@Injectable({ | |
providedIn: 'root', | |
}) | |
export class ApiService { | |
constructor(private http: HttpClient) {} |
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
... | |
@Action(Login) | |
login({ patchState, dispatch, getState }: StateContext<AppStateModel>, { payload }: Login) { | |
let body = {}; | |
let endpoint = ''; | |
if (payload != null) { | |
patchState({ currentUserLoading: true }); | |
body = payload; |
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
#! /bin/bash | |
# Checks if rclone exists | |
if ! command -v rclone &> /dev/null | |
then | |
echo "install rclone first" | |
exit; | |
fi | |
# Checks if ~/OneDrive directory exists |