Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile
@easierbycode
easierbycode / num-range-v-for.vue
Created December 11, 2018 15:49
number range using Vue's v-for
<template>
<li v-for='n in 99'>{{ n }} bottles of beer on the wall..</li>
</template>
@easierbycode
easierbycode / fill-array.js
Created November 30, 2018 15:04
fill number range in an array
Array(42).fill().map((i, idx) => arr[i] = idx+1)
//(42) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42]
@easierbycode
easierbycode / apt.sh
Created November 22, 2018 19:00
headmelted VS Code installer w/ --allow-unauthenticated arg added
#!/bin/sh
echo "Detecting architecture...";
MACHINE_MTYPE="$(uname -m)";
ARCH="${MACHINE_MTYPE}";
REPO_VENDOR="headmelted";
echo "Ensuring curl is installed";
apt-get install -y curl;
@easierbycode
easierbycode / PowerShell_notes.ps1
Last active January 29, 2019 16:18
PowerShell notes - grep, get process by port, $PATH, etc
# get $PATH
[Environment]::GetEnvironmentVariable('path', 'machine')
# get process by port
Get-Process -Id (Get-NetTCPConnection -LocalPort portNumber).OwningProcess
# grep like functionality
$vueWarns = $cmdOutput | Out-String -Stream | Select-String "^(?!.*rootGetters).*(Vue warn).*$"
if ($vueWarns.Length -gt 0) {
}

to create PWA:

ng add @angular/pwa [this will create app/manifest.json]

  • ?: doesn't seem to work from CLI in angular-electron app
@easierbycode
easierbycode / routes.ts
Last active August 8, 2018 20:06
ng2-fundamentals (github.com/jmcooper/ng2-fundamentals)
import { Routes } from '@angular/router'
import { EventsListComponent } from './events/event-details/event-details.component'
export const appRoutes:Routes = [
{ path : 'events', component: EventsListComponent },
{ path : '', redirectTo: '/events', pathMatch : 'full' }
]
@easierbycode
easierbycode / adventure.js
Last active August 8, 2018 18:19
Game: Code Your Own Adventure! --->CodeAcademy
var age = prompt("What's your age?");
if(age < 13)
{
console.log ("You can not play :(");
}
else
{
console.log("Yay you can play!");
}
@easierbycode
easierbycode / game.js
Last active December 13, 2019 21:30
Phaser3 minimal template (100% canvas w/ resize)
import { Scene } from 'phaser'
export class Game extends Scene {
constructor () {
super({
key: 'game'
})
this.staticBg = null
this.scrollingBg = null
}
#include <switch.h>
#include <stdio.h>
int main(int argc, char** argv) {
u32 kdown = 0x00000000;
u32 kdownOld = 0x00000000;
gfxInitDefault();
consoleInit(nullptr); //Init the console
@easierbycode
easierbycode / memory.ts
Created April 10, 2018 17:32
lifelab-tests
declare var StateMachine: any;
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
var r, o, s, a;
r = function() {
function t() {}
return t['random'] = function(t, e, n) {