Skip to content

Instantly share code, notes, and snippets.

@isao
isao / brew-bundle-brewfile-tips.md
Created September 24, 2022 23:18 — forked from ChristopherA/brew-bundle-brewfile-tips.md
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@isao
isao / github-proxy-client.js
Created March 11, 2022 19:24 — forked from DavidWells/github-proxy-client.js
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})
@isao
isao / api_generator.js
Created March 11, 2022 19:24 — forked from v1vendi/api_generator.js
REST API functional generator
const fetch = (...args) => console.log(...args) // mock
function httpRequest(url, method, data) {
const init = { method }
switch (method) {
case 'GET':
if (data) url = `${url}?${new URLSearchParams(data)}`
break
case 'POST':
case 'PUT':
case 'PATCH':
@isao
isao / runloop-decorators.js
Created January 26, 2021 19:54
`this.args` is undefined in methods wrapped with these decorators.
import { debounce as _debounce, throttle as _throttle } from '@ember/runloop';
function timingDecorator(fn) {
return function (delay) {
return function (instance, property, descriptor) {
return {
value(...args) {
if (!instance.isDestroying && !instance.isDestroyed) {
return fn(instance, descriptor.value, ...args, delay);
}
@isao
isao / use-bbdiff
Created January 21, 2021 19:07 — forked from wholmgren/use-bbdiff
set git difftool to bbdiff
git config --global diff.tool bbdiff
git config --global difftool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
git config --global difftool.prompt false
git config --global merge.tool bbdiff
git config --global mergetool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
Double check ~/.gitconfig
@isao
isao / types.ts
Created January 14, 2021 01:15 — forked from ClickerMonkey/types.ts
Typescript Helper Types
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// when T is a tuple, Y is returned, otherwise N
// valid tuples = [string], [string, boolean],
// invalid tuples = [], string[], (string | number)[]
@isao
isao / line-clamp.scss
Last active March 4, 2021 21:56
dma/app/styles/core/mixins/line-clamp.scss
///
/// Line-Clamp
///
/// https://medium.com/@elad/trimming-multi-lines-in-css-5ae59d5e6d84
///
@mixin line-clamp($lines: null) {
@if $lines != null {
display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
-webkit-line-clamp: $lines;
@isao
isao / plink-plonk.js
Created March 30, 2020 16:03 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@isao
isao / com.startup.plist
Created March 24, 2020 17:36 — forked from codeZoner/com.startup.plist
Launch Demon Start up with Bash Script with MySQL Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Launch Daemon do not always have access to all the path variables
As a results, scripts will sometimes fail if the you are using path variables inside them
To enable the script to have access to all path variables, open up a terminal and type in -->
<!-- echo $PATH -->
<!-- You can opt to filter out some of the path variables which are not required by script-->
<key>EnvironmentVariables</key>
@isao
isao / TypeScript.ctags
Created October 30, 2018 23:50
~/.ctags/TypeScript.ctags to index Typescript code
--langdef=TypeScript
--langmap=typescript:.ts
--langmap=typescript:+.tsx
--regex-typescript=/^[ \t]*(export([ \t]+)?)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\3/c,classes/
--regex-typescript=/^[ \t]*(declare)?[ \t]*namespace[ \t]+([a-zA-Z0-9_]+)/\2/n,modules/
--regex-typescript=/^[ \t]*(export)?[ \t]*module[ \t]+([a-zA-Z0-9_]+)/\2/n,modules/
--regex-typescript=/^[ \t]*(export)?[ \t]*function[ \t]+([a-zA-Z0-9_]+)/\2/f,functions/
--regex-typescript=/^[ \t]*export[ \t]+(var|let|const)[ \t]+([a-zA-Z0-9_]+)/\2/v,variables/
--regex-typescript=/^[ \t]*(export)?[ \t]*(public|protected|private)[ \t]+(static)?[ \t]*([a-zA-Z0-9_]+)/\4/m,members/
--regex-typescript=/^[ \t]+([a-zA-Z$_][a-zA-Z0-9$_]*)(<[^>]+>)?\([^\)]*\): .+ \{/\1/m,members/