Skip to content

Instantly share code, notes, and snippets.

View lakesare's full-sized avatar
💭
not a sims logo i just like crystals

Evgenia Karunus lakesare

💭
not a sims logo i just like crystals
View GitHub Profile
juan = 0
gregor = 0
luke = 0
matti = 0
ev = 0
# Ev paid 224.20 lari for the dinner, we divide it equally
ev += 224.20
juan -= 44.84
@lakesare
lakesare / Button.pde
Last active January 7, 2020 21:58
Processing button class
class Button {
private float x, y, w, h;
private String label;
private Runnable onClickRunnable;
public Button(float x, float y, float w, float h, String label, Runnable onClickRunnable) {
this.x = x; this.y = y; this.w = w; this.h = h;
this.font = createFont("Tahoma", 13, true);
this.label = label;
this.onClickRunnable = onClickRunnable;
@lakesare
lakesare / focusOptionsPolyfill.js
Created May 30, 2019 02:48
preventScroll polyfilll
// focus - focusOptions - preventScroll polyfill
const isPreventScrollDefined = () => {
let supportsPreventScrollOption = false
// 1. Create element
const el = document.createElement('div')
// 2. Make sure it won't do anything on focus
el.addEventListener('focus', (event) => {
@lakesare
lakesare / ApplicationCode.js
Last active July 15, 2019 15:55
TransloaditApi.js - application code
import TransloaditApi from './TransloaditApi';
const AWS_S3_URL_PREFIX = 'https://memcode.s3.amazonaws.com/';
const onFileDrop = (event) => {
const file = event.target.files[0];
// 1. Generate unique AWS S3 path
const uniqueAwsS3Path = 'randomFilename.someExtension';
// 2. Create Transloadit assembly
@lakesare
lakesare / TransloaditApi.js
Last active March 21, 2019 20:15
Example of Transloadit TUS upload with simple fetch and tus-js-client
import TusJsClient from 'tus-js-client';
const TRANSLOADIT_AUTH_KEY = 'bbbb889ccccc211e984444d105c7e04b7';
const createAssembly = (uniqueAwsS3Path) => {
const formData = new FormData();
formData.append('params', JSON.stringify({
auth: {
key: TRANSLOADIT_AUTH_KEY
},
@lakesare
lakesare / write.js
Created August 1, 2018 13:34
group_by sql vs js
SELECT COUNT(MOVIES.ID), MOVIES.DIRECTOR
FROM MOVIES
GROUP BY MOVIES.DIRECTOR
@lakesare
lakesare / index.js
Created July 26, 2018 03:15
Url-.html-view
/dashboard-modules/1 -
class UserBillingInfo(models.Model):
user = models.OneToOneField(User, unique=True)
payment_token = models.CharField(max_length = 20)
is_current = models.BooleanField(default = False)
active_until = models.DateField( default=datetime.now()+timedelta(days=365), null=True, blank=True )
billing_phone = models.DecimalField(default=0, max_digits=12, decimal_places=0)
billing_address = models.CharField(max_length = 160)
billing_city = models.CharField(max_length = 38)
billing_zip = models.PositiveIntegerField(default = 0)
billing_state = models.CharField(max_length = 2)
@lakesare
lakesare / try_raw.css
Last active July 13, 2018 22:24
Pdf css
body {
position: relative;
top: -928px;
left: -1076px;
color: #373737;
font-family: Arial, sans-serif;
font-size: 17px;
line-height: 24px;
max-width: 100%;
width: 100% !important;
function Player(name){
this.name = name;
}
Player.prototype.onLoaded = () => {};
Player.prototype.on = function (eventName, callback) {
if (eventName === 'loaded') {
this.onLoaded = callback;
}
};
Player.prototype.load = function () {