Skip to content

Instantly share code, notes, and snippets.

@rspencer01
rspencer01 / Beetroot key
Created June 18, 2015 19:14
Public keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQE5nKOpG/A99nCSn05nKr3znlIUcyr3a0M/ZijUpYkEWvd5xsqGoL7bAbdS1UennIekN7EVvEvNzo2DMBkW1N8C3e3KFrKBemfKlGw5jZ2q5QxxZ/ordmmILr7wQcOibFLSuWoXMDJrfyVkG1DLKK/RFhyGYJNl08Q+OV3xoM8gbdX75sUFgK7rVqs+P7XwXIwZrAGozPrOpotUif1+ebgcrIk2d0lHWDaly/nH1dtXj5l/NP3V03XPeVHLbAXDvVfr8zUfmUDh18xjEZ3W7ewrynYcaPHWKRq2BB21Jo1T06RdkpoxqsKQJwdd0FT1D1Erxbt1ck5ysu9VEdp0qB sarah@Beetroot
@rspencer01
rspencer01 / gist:a512f7cd24055c948675be15d48eba78
Created February 8, 2017 11:17
To install android yoga sample
$ git clone https://github.com/facebook/yoga.git
$ cd yoga
$ buck install -r android/sample
@rspencer01
rspencer01 / layout.xml
Last active April 13, 2017 14:39
Sample Yoga Layout
<?xml version="1.0" encoding="utf-8" ?>
<YogaLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:yoga="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
yoga:yg_alignItems="stretch"
>
<YogaLayout
android:layout_width="match_parent"
@rspencer01
rspencer01 / layout.xml
Last active April 13, 2017 14:38
Android Yoga usage
<YogaLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
yoga:yg_justifyContent="stretch">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
yoga:yg_flex="1"/>
<VirtualYogaLayout
android:layout_width="wrap_content"
@rspencer01
rspencer01 / build.gradle
Created March 7, 2017 10:39
Including yoga in an android project
compile 'com.facebook.yoga.android:yoga-layout:1.2.0'
@rspencer01
rspencer01 / build.gradle
Created March 7, 2017 10:40
Including yoga in android projects
compile 'com.facebook.yoga:yoga:1.2.0'
@rspencer01
rspencer01 / encrypter.c
Created January 20, 2018 15:23
Encrypts a JSON with Cape
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "src/Cape_c.h"
int main() {
cape_t cape;
cape_init(&cape, "THISISAKEY", 10, 210);
const char* message = "{\n'positions' :\n[0.449359147665,0.768063176032,0.15703541789,0.94458536882,0.21469166079,0.287691192213,0.881417496469,0.5292676022,0.762144864619]}";
unsigned char encrypted[220];
@rspencer01
rspencer01 / break.py
Created January 20, 2018 15:24
Breaks a message encrypted with Cape
enc = open('enc').read().split(',')
for i in xrange(len(enc)):
enc[i] = int(enc[i][2:],16)
length = len(enc)-1
ALPHABET = '0.123456789[],\'positions:{}\n '
def all_choices_for(x):
if len(x)>1:
for i in x[0]:
0x2f,0x43,0x60,0x2a,0x35,0x32,0x29,0x3f,0x24,0x3f,0x3a,0x3c,0x6d,0x61,0x7a,0x7d,0x44,0x0e,0x64,0x71,0x65,0x78,0x71,0x60,0x6b,0x6c,0x7f,0x67,0x75,0x6f,0x76,0x6e,0x4a,0x5d,0x58,0x5c,0x4c,0x59,0x48,0x55,0x4f,0x50,0x58,0x44,0x42,0x5a,0x5a,0x4f,0x5e,0x5b,0x5d,0x42,0x57,0x4d,0x40,0x5b,0x52,0x4c,0x4b,0x4f,0x40,0x48,0x50,0x55,0x27,0x31,0x30,0x3a,0x39,0x29,0x2b,0x35,0x36,0x3d,0x2c,0x2f,0x22,0x27,0x22,0x3a,0x21,0x3e,0x35,0x26,0x24,0x2f,0x32,0x28,0x3f,0x31,0x34,0x31,0x3a,0x2d,0x2c,0x30,0x07,0x14,0x0d,0x1e,0x02,0x1f,0x12,0x0d,0x1a,0x1d,0x02,0x1f,0x11,0x05,0x04,0x1a,0x13,0x0d,0x0e,0x1c,0x1e,0x07,0x09,0x17,0x0d,0x0e,0x11,0x0d,0x03,0x03,0x1c,0x00,0xf0,0xfd,0xe4,0xf9,0xf6,0xf1,0xf6,0xf4,0xea,0xf3,0xfe,0xe6,0xe6,0xf1,0xfe,0xf7,0xf8,0xe4,0xf5,0x8a,0xbd,0xdd
Trying key length 1
Trying key length 2
Trying key length 3
Trying key length 4
Trying key length 5
Trying key length 6
Trying key length 7
Trying key length 8
Trying key length 9
@rspencer01
rspencer01 / Output of rustc
Last active August 25, 2022 09:31
Unicode identifiers
error: Ferris cannot be used as an identifier
--> foo.rs:5:9
|
5 | let 🦀 = "Ferris";
| ^^ help: try using their name instead: `ferris`
error: aborting due to previous error