- Оголошення функції - def_def
- Порядок оголошення та виклику - def_order
- Повернення результату - def_return
- Перевизначення функції - def_redef
- Збереження функції у перемінінй - def_storing
- Видимість перемінних - def_var_visibility
- Аргументи - def_args
- Зміна переданого аргументу - def_args_ch
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 | |
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it! | |
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS. | |
# This script needs to be run from the volume you wish to use. | |
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh | |
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars. | |
# Get active services: launchctl list | grep -v "\-\t0" | |
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents |
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 { flatten } from './list' | |
test('Should return array if not an array', () => { | |
assert(flatten(1)).toMatchObject([1]) | |
}) | |
test('Should return array if an array', () => { | |
assert(flatten([1])).toMatchObject([1]) | |
}) |
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
let str = ` | |
email1@me | |
email2@me | |
email3@me;email4@me | |
` | |
const parsed = str | |
.split(';') | |
.map(line => { | |
return line |
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
env_file_names=( | |
'./.env' | |
'./.env.local' | |
) | |
for file in ${env_file_names[*]} | |
do | |
if [ -f "${file}" ]; then | |
echo "Found local environment file: $file" | |
echo "Loading..." | |
. $file |
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
#!/usr/bin/env node | |
'use strict'; | |
const validate = require('html-angular-validate'); | |
validate.validate( | |
[ | |
"src/app/ui/**/*.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
import path from "path"; | |
function WebpackRequireListPlugin() {} | |
WebpackRequireListPlugin.prototype.apply = function(compiler) { | |
compiler.plugin("emit", function(compilation, callback) { | |
let filelist = {}; | |
compilation.modules.forEach((item, index) => { | |
let query = path | |
.relative(process.cwd(), item.userRequest) |
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("app").decorator("$controller", ['$delegate', function($delegate: Function) { | |
return function(constructor, locals) { | |
let controller = $delegate.apply($delegate, arguments); | |
if (constructor === NLayoutDesigner) { | |
console.log(controller); | |
return angular.extend(function () { | |
locals.$scope.smth = "somewhat"; | |
return controller(); | |
}, controller); | |
} |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" http://stackoverflow.com/questions/878972/windows-cmd-encoding-change-causes-python-crash#answer-3259271 | |
""" | |
import sys | |
if sys.platform == "win32": | |
import codecs |