Skip to content

Instantly share code, notes, and snippets.

View simonemarra's full-sized avatar
🐈‍⬛

Simone Marra simonemarra

🐈‍⬛
View GitHub Profile
@simonemarra
simonemarra / fluttercleanrecursive.sh
Created December 7, 2022 12:38 — forked from jeroen-meijer/fluttercleanrecursive.sh
Flutter Clean Recursive - Clear up space on your hard drive by cleaning your Flutter projects. This script searches for all Flutter projects in this directory and all subdirectories and runs 'flutter clean'. Note: may take a long time for folders with large amounts of projects.
#!/bin/sh
# To run, download the script or copy the code to a '.sh' file (for example 'fluttercleanrecursive.sh') and run like any other script:
# sh ./fluttercleanrecursive.sh
# or
# sudo sh fluttercleanrecursive.sh
echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)"
echo "Looking for projects... (may take a while)"
@simonemarra
simonemarra / delete-network-services.md
Created January 25, 2022 15:48
MACOS | delete network services from terminal

$ networksetup -listallnetworkservices | grep STARTING-NETWORK-NAME | sed s/*// | while read -r service; do networksetup -deletepppoeservice $service; done

@simonemarra
simonemarra / pm2_ubuntu.sh
Created August 12, 2020 11:01 — forked from WillDent/pm2_ubuntu.sh
Installation of PM2 on Ubuntu so it autostarts scripts
# Requirements:
# Node Installed
# Safe User that is running as node
#1) Install pm2
sudo npm install -g pm2
#2) Set-up PM2 to autostart upon server rebooting
#sudo env PATH=$PATH:/usr/local/bin pm2 startup <platform> -u <safe_user_not_root>
sudo env PATH=$PATH:/usr/local/bin pm2 startup ubuntu -u ubuntu
@simonemarra
simonemarra / NoSwipeBackPageRenderer.cs
Created January 10, 2020 10:00
Xamarin Forms (iOS): disable swipe back on provided page via custom renderer
using Xamarin.Forms;
[assembly: ExportRenderer(typeof(Appname.Views.DeviceInfoPage), typeof(Appname.iOS.Renderers.NoSwipeBackPageRenderer))]
namespace Appname.iOS.Renderers
{
// Custom Rendered to disable the swipe back of provided page type (in this case DeviceInfoPage...)
// source: https://forums.xamarin.com/discussion/26966/how-to-disable-swipe-gesture-on-pushed-page
public class NoSwipeBackPageRenderer : PageRenderer
{
public override void ViewDidAppear(bool animated)
@simonemarra
simonemarra / MainActivity.cs
Last active January 7, 2020 11:32
Xamarin Android: lock font scale accessibility to default value
// source: https://forums.xamarin.com/discussion/81842/prevent-change-font-size
// Add this code to MainActivity.cs class to force FontScaling to default (1.0) value:
protected override void AttachBaseContext(Context @base)
{
var configuration = new Configuration(@base.Resources.Configuration);
//0.85 small, 1 standard, 1.15 big,1.3 more bigger ,1.45 super big
configuration.FontScale = 1f;
var config = Application.Context.CreateConfigurationContext(configuration);
base.AttachBaseContext(config);
@simonemarra
simonemarra / index.html
Created November 21, 2018 11:37
SVG Path Builder
<div
id="app"
class="ad-App">
</div>
@simonemarra
simonemarra / random_in_range.c
Created January 10, 2018 13:54
C code random in range (int8_t result may be changed with other values as well). Prints results on console - tested with GCC and Code::Blocks
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <time.h>
#define _MIN_ -10
#define _MAX_ 50
#define _RANGE_ _MAX_-_MIN_
@simonemarra
simonemarra / stream.js
Created November 2, 2017 15:43 — forked from padenot/stream.js
How to serve media on node.js
var http = require('http');
var path = require('path');
var fs = require('fs');
var AUDIOFILE = "./audio.ogg";
function serveWithRanges(request, response, content) {
var range = request.headers.range;
var total = content.length;
var parts = range.replace(/bytes=/, "").split("-");
#include <fsl_port.h>
#include <fsl_gpio.h>
#include <fsl_debug_console.h>
#include <fsl_sai.h>
#define RX_SAI_IRQ I2S0_Rx_IRQn
#define SAI_RxIRQHandler I2S0_Rx_IRQHandler
bool isFinished = false;
uint32_t temp[2000];