Skip to content

Instantly share code, notes, and snippets.

Avatar
👌
Enjoying life, including work.

Balint Erdi balinterdi

👌
Enjoying life, including work.
View GitHub Profile
@balinterdi
balinterdi / application.hbs
Last active Jan 23, 2020
Refresh a route's @model – this one re-renders the template with the new song
View application.hbs
<div class="h-screen w-full bg-blue-800 text-gray-100">
<div class="w-full xl:w-1/3 mx-auto">
<div class="h-12 flex items-center mb-4 border-b-2">
<h1 class="font-bold text-2xl">Rock & Roll <span class="font-normal">with Ember.js</span></h1>
</div>
<div class="w-full">
<div class="">
<ul>
{{#each @model as |song|}}
<li>
View IconArrow.svelte
<script>
export let fill;
export let stroke;
export let strokeWidth;
export let rotation;
</script>
<svg viewBox="0 0 24 24" class="w-6" xmlns="http://www.w3.org/2000/svg">
<path
d="m11 14.59v-7.59a1 1 0 0 1 2 0v7.59l2.3-2.3a1 1 0 1 1 1.4 1.42l-4 4a1 1 0 0 1 -1.4 0l-4-4a1 1 0 0 1 1.4-1.42z"
@balinterdi
balinterdi / bubblesort.lua
Created Jul 12, 2019
A highly efficient bubble sort algorithm in Lua
View bubblesort.lua
function print_array(a)
local i = 1
while a[i] do
print(a[i])
i = i + 1
end
end
function bubblesort(t)
local swapsMade;
@balinterdi
balinterdi / ember-font-awesome.ts
Last active Jul 3, 2019
First stab at Embroider compat-adapter for ember-font-awesome
View ember-font-awesome.ts
import V1Addon from '../v1-addon';
import { AddonMeta } from '@embroider/core';
export default class EmberFontAwesome extends V1Addon {
get packageMeta(): Partial<AddonMeta> {
let meta = super.packageMeta;
meta['public-assets'] = {
'node_modules/font-awesome/fonts/FontAwesome.otf': '/fonts/FontAwesome.otf',
};
for (let extension of ['eot', 'svg', 'ttf', 'woff', 'woff2']) {
@balinterdi
balinterdi / application.js
Created Jul 3, 2019
Setting document title in the application route
View application.js
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default Route.extend({
currentUser: service(),
router: service(),
init() {
this._super();
this.setDocumentTitle();
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAnMnNV3Wonaxa0BHY5gTelsUpet1qRfEhzJUGN04tD1gXXAZnF+iDBQcw7g7600MS0OsXbiquQYiyqEhnnLpUv4fMmN+aEoqh20+smU6iKbHN2RwXwb7NRQ6kzHyQD+QC+/6MJjOsdjCibLmljMwGUh1MKw+AQ248cooSJdpHKqs=
View ethers
0x1E65F71b024937b988fdba09814d60049e0Fc59d
@balinterdi
balinterdi / copy-text-to-clipboard.js
Created Jul 27, 2017
Copy some text to the clipboard using the brower's DOM API
View copy-text-to-clipboard.js
export default function copyTextToClipboard(text) {
let textArea = document.createElement("textarea");
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
try {
// Now that we've selected the anchor text, execute the copy command
let successful = document.execCommand('copy');
let message = successful ? 'successful' : 'unsuccessful';
@balinterdi
balinterdi / settings.json
Created May 26, 2017
My VSCode configuration
View settings.json
{
"window.zoomLevel": 1,
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/tmp": true,
"node_modules": true, // this excludes the folder
// only from the root of
// your workspace
"tmp": true,
@balinterdi
balinterdi / router.js
Created Apr 25, 2017
Log in in a modal (lightbox), without the page "underneath" disappearing
View router.js
Router.map(function() {
this.route('about-us', function() {
this.route('login', { path: '/' }); // or you can even have a different path if you don't mind the URL change
});
});
You can’t perform that action at this time.