Skip to content

Instantly share code, notes, and snippets.

View kosso's full-sized avatar

Kosso kosso

View GitHub Profile
@straker
straker / README.md
Last active September 3, 2023 21:28
Basic Frogger HTML and JavaScript Game

Basic Frogger HTML and JavaScript Game

This is a basic implementation of the Konami Frogger game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Lives
  • Frogger starts with 6 lives and should lose a life whenever it is hit by a vehicle or lands in the water
@kriegsman
kriegsman / Pacifica.ino
Last active January 27, 2024 04:25
Pacifica: gentle, blue-green ocean waves. For Dan.
//
// "Pacifica"
// Gentle, blue-green ocean waves.
// December 2019, Mark Kriegsman and Mary Corey March.
// For Dan.
//
#define FASTLED_ALLOW_INTERRUPTS 0
#include <FastLED.h>
FASTLED_USING_NAMESPACE
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@dctalbot
dctalbot / get_color.js
Created June 26, 2019 20:26
Get Common or "Dominant" Color from Image
drawImage = async img_path => {
let canvas = document.createElement("canvas");
canvas.src = img_path;
const context = canvas.getContext("2d");
const img = await loadImage(img_path);
canvas.width = img.width;
canvas.height = img.height;
context.drawImage(img, 0, 0);
@Topener
Topener / index.js
Created June 6, 2019 10:06
Titanium bottomsheet simple example
var startMove = 0;
var bottomSheet = Ti.UI.createView({
height: 300,
width: Ti.UI.FILL,
backgroundColor: "red",
bottom: -300,
zIndex: 50
});
var overlay = Ti.UI.createView({
@thiagomarini
thiagomarini / index.php
Last active August 7, 2021 16:34
Plain PHP Curl proxy script example for json APIs. I tried using Apache mod_proxy for that but it was returning 301 only on curl, on guzzle it was fine.
<?php
// Needs to be used with a .htaccess file pointing all requests to it
$uri = $_SERVER['REQUEST_URI'];
$queryString = http_build_query($_GET);
$payload = file_get_contents('php://input');
$url = 'https://foo.bar' . $uri;
@bvandenbon
bvandenbon / cookieservice.service.ts
Last active December 4, 2020 10:29
CookieService
import { Injectable } from '@angular/core';
@Injectable()
export class CookieService {
constructor() {
}
set(key: string, value: string): void;
set(key: string, value: string, expires: Date): void;
@liz-ete
liz-ete / hyperloopMediaRedorder.js
Last active June 21, 2019 19:47
Use of Android's MediaRecorder with Titanium Hyperloop to record audio.
// Please refer to Android's MediaRecorder documentation:
// https://developer.android.com/reference/android/media/MediaRecorder
var MediaRecorder = require('android.media.MediaRecorder');
var recorder = new MediaRecorder();
function recordAudio() {
var recordPermission = "android.permission.RECORD_AUDIO";
var hasRecordPermission = Ti.Android.hasPermission(recordPermission);
@hansemannn
hansemannn / app.js
Created July 11, 2018 02:00
Microphone monitoring in Appcelerator Titanium using the AVAudioRecorder API
'use strict';
var ButtonTitle = {
START: 'Start Microphone Monitoring',
STOP: 'Stop Microphone Monitoring'
};
Object.freeze(ButtonTitle);
var started = false;
@sabas1080
sabas1080 / ESP32_HID.ino
Last active January 28, 2024 10:34
Example of HID Keyboard BLE with ESP32
/*
Copyright (c) 2014-2020 Electronic Cats SAPI de CV. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of