Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile

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) {
const MAX_PLAYERS = 4;
const haveEvents = 'ongamepadconnected' in window;
const controllers = {};
// D-PAD AND BUTTONS
// (U, D, L, R, B, A, START)
const buttons = {
U : 12,
D : 13,
L : 14,
R : 15,
var game;
window.onload = function() {
var isMobile = navigator.userAgent.indexOf("Mobile");
if (isMobile == -1) {
game = new Phaser.Game(480, 640, Phaser.AUTO, "ph_game");
} else {
game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, "ph_game");
}
game.state.add("StateMain", StateMain);
@easierbycode
easierbycode / form-sheet-firebase-updater.gs
Created January 17, 2018 21:59
form -> sheet, date triggered email sender, Firebase updater
/**
* A special function that runs when the spreadsheet is open, used to add a
* custom menu to the spreadsheet.
*/
function onOpen() {
var spreadsheet = SpreadsheetApp.getActive();
var menuItems = [
{name: '📧 Send pending unlocks...', functionName: 'sendEmailAndUnlockNextTest'}
];
spreadsheet.addMenu('🔬 Baylor', menuItems);
@easierbycode
easierbycode / crouton_on_chromebook_pro.txt
Last active April 22, 2022 08:03
Crouton on Chromebook Pro: unboxing, to VS Code
- developer mode (hold ESC, refresh, and power buttons till insert USB screen comes up, then hit CTRL + D)
- download crouton
sudo sh ~/Downloads/crouton -t xiwi -n code-oss-chroot
sudo enter-chroot -n code-oss-chroot sudo -S sh -c "$( curl -s https://code.headmelted.com/installers/apt.sh )"
(if "unauthenticated packages" error:)
sudo enter-chroot -n code-oss-chroot sudo -S sh -c "$( curl -s https://gist.githubusercontent.com/easierbycode/ea16d448e32608abfb35589399bb4b10/raw/c98815b6a9ad3cabcf99f90a66fa1391f97f940a/apt.sh )"
sudo echo "alias code=\"sudo startxiwi -n code-oss-chroot code-oss\"" >> ~/.bashrc