Skip to content

Instantly share code, notes, and snippets.

@evoactivity
evoactivity / export.gjs
Last active March 14, 2024 22:04
export default gjs
<template>
<textarea>{{current}}</textarea>
</template>
@evoactivity
evoactivity / export.gts
Last active March 14, 2024 23:11
undeclared default export
<template>
<textarea>{{current}}</textarea>
</template>
@evoactivity
evoactivity / history-location.d.ts
Last active February 16, 2024 12:23
Eager loading urls for Ember & trailing slash
import EmberObject from '@ember/object';
declare module '@ember/routing/history-location' {
// More info about interface over here - https://github.com/emberjs/ember.js/blob/v3.28.1/packages/%40ember/-internals/routing/lib/location/api.ts
export default class HistoryLocation extends EmberObject {
protected history: History;
replaceURL(url: string): void;
setURL(path: string): void;
getURL(): string;
formatURL(url: string): string;
@evoactivity
evoactivity / dedupe.ts
Created February 17, 2023 16:32
Deduplicate Git Ignore (.gitignore)
/**
* Remove duplicates from .gitignore
*
* This function reads the .gitignore file, removes duplicates, and overwrites the gitignore file.
*
* @param pathToLocalRepo - Path to the local git repository. Default is the current working directory.
*/
async function dedupeGitIgnore(pathToLocalRepo: string | null = null): Promise<void> {
if (!pathToLocalRepo) {
pathToLocalRepo = Deno.cwd();
@evoactivity
evoactivity / openvpn_pia
Created January 29, 2023 21:54
How to setup headless (No GUI/CLI Only) ubuntu openvpn pia
## Install OpenVPN
# Now we install and configure OpenVPN, do the following commands:
sudo apt-get install openvpn
cd /etc/openvpn
sudo wget https://www.privateinternetaccess.com/openvpn/openvpn.zip
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'details',
attributeBindings: ['open'],
open: true,
click(e) {
e.preventDefault();
},
actions: {
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
calculatePosition(trigger, content) {
let { top, left, width, height } = trigger.getBoundingClientRect();
let { height: contentHeight } = content.getBoundingClientRect();
let style = {
left: left + width,
import Component from '@ember/component';
export default class MyComponent extends Component {
// constructor() {
// super(...arguments);
// this.tagName = '';
// }
tagName = '';
}
import Component from '@ember/component';
export default class FormControlInputTextComponent extends Component {
tagName = '';
}