Skip to content

Instantly share code, notes, and snippets.

View hiway's full-sized avatar

Harshad Sharma hiway

View GitHub Profile
@0xabad1dea
0xabad1dea / copilot-risk-assessment.md
Last active September 11, 2023 10:21
Risk Assessment of GitHub Copilot

Risk Assessment of GitHub Copilot

0xabad1dea, July 2021

this is a rough draft and may be updated with more examples

GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?

Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@dimaryaz
dimaryaz / dropbox_ext4.c
Created August 15, 2018 07:28
Dropbox ext4 hack
/*
* dropbox_ext4.c
*
* Compile like this:
* gcc -shared -fPIC -ldl -o libdropbox_ext4.so dropbox_ext4.c
*
* Run Dropbox like this:
* LD_PRELOAD=./libdropbox_ext4.so ~/.dropbox-dist/dropboxd
*/
@LeZuse
LeZuse / spotify.sh
Last active June 5, 2019 15:00
A bash helper for controlling Spotify on Mac over osascript
#!/usr/bin/env bash
# Install:
# ln -s $PWD/spotify-cmd.sh /usr/local/bin/spotify
ARG=$@
usage () {
echo "Usage: $0 [play|pause|playpause|next track|previous track]"
}
@jobertabma
jobertabma / git-inspect.sh
Last active March 13, 2018 23:26
A script to manually iterate over git commits. Use qj/qk to navigate.
DIFF_NUMBER=1
while read -n1 -r -p "$DIFF_NUMBER:" && [[ $REPLY != q ]]; do
case $REPLY in
j)
DIFF_NUMBER=`expr $DIFF_NUMBER + 1`
;;
k)
DIFF_NUMBER=`expr $DIFF_NUMBER - 1`
;;
@raspi
raspi / md5move.py
Last active October 1, 2018 21:19
Move files based on file list in a md5 checksum file
#!/bin/env/python
# -*- encoding: utf8 -*-
# Move files based on file list in a md5 checksum file
# (c) Pekka Järvinen 2017-
import logging
log = logging.getLogger(__name__)
import os
@veuncent
veuncent / aws_glacier_delete_vault.md
Last active March 19, 2024 18:16
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 
@marcan
marcan / bloom.py
Last active February 29, 2024 19:55
Simple Bloom filter implementation in Python 3 (for use with the HIBP password list)
#!/usr/bin/python3
#
# Simple Bloom filter implementation in Python 3
# Copyright 2017 Hector Martin "marcan" <marcan@marcan.st>
# Licensed under the terms of the MIT license
#
# Written to be used with the Have I been pwned? password list:
# https://haveibeenpwned.com/passwords
#
# Download the pre-computed filter here (968MB, k=11, false positive p=0.0005):
@toomasv
toomasv / regex.red
Last active November 20, 2017 18:22
Regex to parse translator
Red [
Author: "Toomas Vooglaid"
file: "%regex.red"
Purpose: {Regex to parse converter}
History: {Started: 2017-05-09
v.0.1: 2017-05-12 -- first working version with:
start `^^` and end `$` anchors,
non-capturing groups (one level) with alterns,
quantifiers (possessive),
some character-classes.

Where you able to produce a binary directly from the Rust build tools that you could submit to the app/play store?


Not quite, but I tried to get as close to that as was reasonably possible. Alas, things ended up a little convoluted.

For iOS, I have a nearly empty Xcode project with a build script that copies my cargo produced executable into the .app that Xcode generates (before Xcode signs it). The build script also uses lipo to merge the executables for each architecture I’m targeting (e.g. armv7 and aarch64 for non-simulator devices) into a single, universal binary.

On top of that, there are various iOS-y things that need to happen before my application’s main method is called. SDL2 provides the Objective-C code that does all of that. In a C or C++ game, SDL2 renames main to SDL_main, and then [inserts its own mai