Skip to content

Instantly share code, notes, and snippets.

View simonemarra's full-sized avatar
🐈‍⬛

Simone Marra simonemarra

🐈‍⬛
View GitHub Profile
@nolim1t
nolim1t / socket.c
Created June 10, 2009 03:14
HTTP Request in C using low level write to socket functionality
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
@padenot
padenot / stream.js
Created October 29, 2011 16:33
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("-");
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 20, 2024 11:33
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@WillDent
WillDent / pm2_ubuntu.sh
Last active February 2, 2022 13:34
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
@wosephjeber
wosephjeber / ngrok-installation.md
Last active May 6, 2024 20:19
Installing ngrok on Mac

Installing ngrok on OSX

For Homebrew v2.6.x and below:

brew cask install ngrok

For Homebrew v2.7.x and above:

@darkguy2008
darkguy2008 / UDPSocket.cs
Last active May 20, 2024 19:01
Simple C# UDP server/client in 56 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
#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];
public LoginPage ()
{
InitializeComponent ();
BindingContext = ViewModel;
UsernameEntry.Completed += (sender, args) => { PasswordEntry.Focus(); };
PasswordEntry.Completed += (sender, args) => { ViewModel.AuthenticateCommand.Execute(null); };
}
@dizco
dizco / app.component.ts
Last active December 31, 2021 06:13
Ngx-Admin and Nebular menu translation. Supports nested menu items and live reload
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { Component, OnInit } from '@angular/core';
import { AnalyticsService } from './@core/utils/analytics.service';
import { TranslateService } from '@ngx-translate/core';
@Component({
@cmh114933
cmh114933 / _redirects
Last active May 21, 2024 19:07
Enable Angular Routing on Netlify
/* /index.html 200