Skip to content

Instantly share code, notes, and snippets.

@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);
@magjac
magjac / .block
Last active May 20, 2024 19:01
Growing Graphviz Edges
height: 800
@ansemjo
ansemjo / ubuntu-cleaner.sh
Last active May 20, 2024 18:55
Clean up unwanted packages on a fresh installation of Ubuntu 20.04 LTS
#!/usr/bin/env bash
set -eu
# mark a few packages as explicitly installed
mark-wanted() {
apt install -y \
bash git tmux vim htop \
unattended-upgrades \
software-properties-common;
}
@svaustin66
svaustin66 / Shopify - All Product Photos
Created June 13, 2017 19:49
This liquid code will list all of the products in a store with links to the product admin page and show all product photos under each product
<h2>All Product Images</h2>
{% for product in collections['all'].products %}
<p><a href="/admin/products/{{product.id}}" target="_blank">{{product.title}}</a></p>
{% for image in product.images %}
<p><img src="{{ image.src | product_img_url: "large" }}"></p>
{% endfor %}
{% endfor %}
@antronic
antronic / iphone-usb_tethering-to-rpi.md
Last active May 20, 2024 18:53
iPhone USB Tethering to RPi

iPhone Tethering to Raspberry Pi

Instruction

On RPi

  • sudo apt-get install usbmuxd
  • connect iPhone

On iPhone

  • Trust

" vim rc
set nocompatible
filetype on
filetype plugin on
filetype indent on
syntax on
set relativenumber
set cursorline
set history=10000
set wildmenu
@JaysonChiang
JaysonChiang / api.ts
Last active May 20, 2024 18:46
Example of Axios with TypeScript
import axios, { AxiosError, AxiosResponse } from 'axios';
import token from './somewhere';
interface Todo {
id: string;
title: string;
}
interface User {
id: string;
@alexpchin
alexpchin / Add_Existing_Project_To_Git.md
Created June 1, 2014 20:14
Add Existing Project To Git Repo

#Adding an existing project to GitHub using the command line

Simple steps to add existing project to Github.

1. Create a new repository on GitHub.

In Terminal, change the current working directory to your local project.

##2. Initialize the local directory as a Git repository.

git init
@DanAtkinson
DanAtkinson / Visual Studio solution file headers
Last active May 20, 2024 18:41 — forked from JamesSkemp/Visual Studio solution file headers
Visual Studio solution file headers - 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017, 2019, and 2022
== Visual Studio .NET 2003 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 8.00
# Visual Studio .NET 2003
VisualStudioVersion = 7.1
== Visual Studio 2005 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
VisualStudioVersion = 8.0