Skip to content

Instantly share code, notes, and snippets.

View luke14free's full-sized avatar

Luca Giacomel luke14free

View GitHub Profile
@luke14free
luke14free / riverpod_widget.dart
Created November 16, 2023 23:36
Riverpod non funzionante..
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../settings/settings_view.dart';
import 'sample_item.dart';
import 'sample_item_details_view.dart';
final textControllerProvider = StateProvider<TextEditingController>((ref) {
return TextEditingController();
});
FROZEN_ERROR = 'frozen objects are read only'
def frozen(iterable):
class Frozen(type(iterable)):
def __setitem__(self, key, value):
raise Exception(FROZEN_ERROR)
def __set__(self, instance, value):
raise Exception(FROZEN_ERROR)
@luke14free
luke14free / sin.ipynb
Created September 21, 2018 12:57
sin.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@luke14free
luke14free / FCN_deep_matting.ipynb
Created April 10, 2017 09:09
Deep matting with FCN/VGG16
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@luke14free
luke14free / appstore.html
Last active July 21, 2016 14:05
AppStore
<!DOCTYPE html>
<!-- saved from url=(0031)http://nyc3.stor.re/beta/a/t5vt -->
<html lang="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Followers for Instagram</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@luke14free
luke14free / extract_followers.js
Last active July 13, 2016 15:59
Quick & dirty script to scrape followers from IG
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var all_usernames = [];
function main(){
jQuery.noConflict();
$ = jQuery;
@luke14free
luke14free / sample_usage.py
Last active October 26, 2016 18:36
Simple type checked objects in Python
#!/usr/bin/env python
from type_checked_entities import entity_factory
Giraffe = entity_factory( # let's define what is a giraffe!
"giraffe",
name=str, # my name is a string
age=float, # my age is an int
eats=object, # I eat pretty much everything.
)
@luke14free
luke14free / bernoulli_difference.py
Created April 20, 2016 11:38
Using PyMC to find the probability of the difference between two Binomial experiments
%matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
import pymc as pm
import numpy as np
p = 0.5
lambda_1 = pm.Binomial("lambda_1", 1000, p)
lambda_2 = pm.Binomial("lambda_2", 1000, p)
@luke14free
luke14free / insecure_script.py
Last active November 9, 2016 10:05
Insecure Script Runner for Redash (0.9.x)
import os
import sys
import subprocess
from redash.query_runner import *
class InsecureScript(BaseQueryRunner):
@classmethod
def enabled(cls):
return True
@luke14free
luke14free / efficient_random_slot.py
Last active January 20, 2016 09:29
Randomic, yet efficient slot machine simulator/combination generator with custom win profiles, figures and payoffs.
import itertools
import random
els = range(10) # elements of the slot
wins_profile = dict()
wins_profile[0] = 65
# wins_profile[10] = 15 # don't know any valid combo for this :-)
# wins_profile[20] = 10 # same here
wins_profile[50] = 5