Skip to content

Instantly share code, notes, and snippets.

View linearza's full-sized avatar

linearza

View GitHub Profile
on:
workflow_call:
inputs:
deploy_target:
description: 'Deploy target'
required: true
type: string
default: 'production'
secrets:
GH_TOKEN:
@chrisryana
chrisryana / lint-only-changed-files.MD
Created October 21, 2021 12:30 — forked from seeliang/lint-only-changed-files.MD
How to lint only changed files?

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

git diff --name-only master | grep -E "(.js$|.ts$|.tsx$)"

@lifeart
lifeart / ability.ts
Last active August 4, 2022 12:36
Simple Roles Management
import { get } from 'lodash';
const permissions = {
study: {
see: ['STUDY_MANAGER', 'DATA_ENTRY', 'ADMIN'],
create: ['DATA_ENTRY', 'ADMIN'],
edit: ['STUDY_DIRECTOR', 'DATA_ENTRY', 'ADMIN'],
}
}
@rajasegar
rajasegar / bundles.js
Created November 17, 2018 12:22
Ember Build multiple app trees
/* jshint node : true */
module.exports = [{
name: 'contacts',
packages: ['contacts'],
handledRoutesPatterns: ['/contact'],
routeNames: ['^contact']
}];
@myshov
myshov / function_invocation.js
Last active January 21, 2024 15:14
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@dhoko
dhoko / coutLines.es6.js
Last active January 4, 2017 08:00
Count lines added/removed with Bitbucket
(() => {
const CLASS_LIST = [
{type: 'added', className: '.lines-added'},
{type: 'removed', className: '.lines-removed'}
];
const stats = CLASS_LIST
.reduce((accus, o) => {
const total = Array
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@willurd
willurd / web-servers.md
Last active June 21, 2024 13:36
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@xeoncross
xeoncross / gitstats.sh
Created November 5, 2012 21:35
Git - calculate how many lines of code were added/changed by someone
# Run this in the project repo from the command-line
# http://stackoverflow.com/a/4593065/99923
git log --shortstat --author "Xeoncross" --since "2 weeks ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'