View flappy-bird.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import touch | |
import display | |
bird_up = True # EricAndre | |
col_pos_x = 600 | |
bird_pos_y = 280 | |
game_over = False | |
def move_up(arg): |
View bl-monocle-ar-gists.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import device | |
import display | |
def draw_welcome(placeholder_arg): | |
display.text("Welcome, <name>", 150, 175, 0xffffff) | |
def weather_report(placeholder): | |
display.text("Weather in <Location>", 100, 125, 0xffffff) | |
display.text("43F Cloudy", 100, 175, 0xffffff) |
View sample.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"url": "", | |
"auth_interactions": [ | |
{ | |
"type": "input", | |
"name": "email", | |
"dom_target": "input[type=email]", | |
"value_lookup": "random-string-for-env" | |
}, | |
{ |
View fifo-math-for-cbp.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const processBuySells = (activePortfolio, fills) => { | |
const btcBuys = []; | |
const btcSells = []; | |
// transfers, this is a special case | |
if (parseInt(activePortfolio) === 1) { | |
const transferredArr = JSON.parse(process.env.TRANSFERRED_BTC_ARR); | |
transferredArr.forEach(transfer => { | |
btcBuys.push({ | |
size: parseFloat(transfer.size), |
View calorie-counter-app-reactjs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import './../../misc/styles/layout.scss'; | |
import './BasicInterface.scss'; | |
import { isObject } from './../../misc/js/utilities.js'; | |
import closeIcon from './../../misc/icons/close-icon__chocolate.svg'; | |
class BasicInterface extends Component { | |
state = { | |
date: new Date(), | |
today: null, |
View array-serialization-php.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// a:0:{} | |
// a:1:{i:0;i:5694;} // add 5694 | |
// a:2:{i:0;i:5694;i:1;i:5934;} // add 5934 | |
// a:3:{i:0;i:5694;i:1;i:5934;i:2;i:5608;} // add 5608 | |
// a:2:{i:0;i:5694;i:2;i:5608;} remove 5934 | |
// a:3:{i:0;i:5694;i:1;i:5608;i:2;i:5934;} readd 5934 | |
$str = 'a:3:{i:0;i:5694;i:1;i:5934;i:2;i:5608;}'; |
View remove-scripts-from-string-php.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ps this does not work, use HTML Purifier | |
// I mean this works, but it's not guaranteed to fix the problem | |
// wth nested functions don't work as expected hmm | |
// probably time to learn OOP, look at that $GLOBAL, could not get the final output out of the function | |
// tried passing it in as parameter, regular global | |
// another note, to avoid case sensitivity use str_ireplace so you can match script, SCRIPT, ScRiPt, without | |
// worrying about exact str index position, or just don't do this entirely |
View make-call.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The URL is an XML file telling Twilio's phone call "bot?" what to do | |
View an example here https://gist.github.com/jdc-cunningham/af131c042309d1ccd8acd5bcc626b0de | |
The code below is from Twilio's example | |
https://www.twilio.com/docs/voice/make-calls | |
*/ | |
<?php |
View msg.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- this is based on Twilio's example https://demo.twilio.com/docs/voice.xml --> | |
<Response> | |
<Say voice="alice"> | |
Your message | |
</Say> | |
</Response> |
View encrypt-decrypt-php-defuse.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// error checking | |
ini_set('display_errors', 1); | |
// require php-defuse.phar | |
require_once('defuse-crypto.phar'); | |
use Defuse\Crypto\Crypto; | |
use Defuse\Crypto\Key; |
NewerOlder