Skip to content

Instantly share code, notes, and snippets.

View crazyquark's full-sized avatar

Cristian Sandu crazyquark

View GitHub Profile
@matthewSorensen
matthewSorensen / Bearing.scad
Created January 12, 2012 07:52
A parametric bearing in OpenSCAD
function radius_to_balls(r_ball, r) = 180 / asin(r_ball / r);
function ball_to_radius(n, r) = r * sin(180 / n);
module Bearing(outer, inner, attempt, gap, hole, height) {
n = round(radius_to_balls(attempt, inner));
r = ball_to_radius(n, inner);
theta = 360 / n;
pinRadius = 0.5 * r;
// The pins:
for(i = [0 : n])
@mike3k
mike3k / chk_enrypt.c
Created June 19, 2012 20:15
Check for encrypted iOS binary
#import <dlfcn.h>
#import <mach-o/loader.h>
/* The encryption info struct and constants are missing from the iPhoneSimulator SDK, but not from the iPhoneOS or
* Mac OS X SDKs. Since one doesn't ever ship a Simulator binary, we'll just provide the definitions here. */
#if TARGET_IPHONE_SIMULATOR && !defined(LC_ENCRYPTION_INFO)
#define LC_ENCRYPTION_INFO 0x21
struct encryption_info_command {
@oysteinjakobsen
oysteinjakobsen / gist:e59cdd38a688ee8a418a
Last active August 7, 2019 14:38
How to get docker-compose (fig) up and running on Raspberry Pi 2

Background

I assume you already have Docker up and running on your Raspberry Pi 2. If not, see this article.

The next natural step is to install Docker Compose (formerly Fig), but there's no ARM support out of the box. This recipe will help you install Docker Compose on your Raspberry Pi 2!

The following six steps will do the trick:

  1. Get the docker-compose source code from git
@konradko
konradko / golang_on_rpi.md
Last active April 12, 2020 17:36
Install Golang 1.7 on Raspberry Pi
wget https://storage.googleapis.com/golang/go1.7.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.7.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
@ph1ee
ph1ee / mserv.py
Created September 25, 2015 11:33
Simple Bottle MJPEG Streamer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Inspired by:
* http://weeklybuild.com/2014/07/07/mjpeg-bottle-gstreamer/
* http://www.ridgesolutions.ie/index.php/2014/11/24/streaming-mjpeg-video-with-web2py-and-python/
* https://gist.github.com/n3wtron/4624820
'''
import os
import struct
import marshal
import zlib
import sys
import imp
import types
class CTOCEntry:
def __init__(self, position, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name):
@eternalstorms
eternalstorms / Apple Evangelists.txt
Created June 12, 2013 09:07
Apple Evangelists (WWDC 2013)
UI- and App Frameworks Evangelist - Jake Behrens, behrens@apple.com, twitter: @Behrens
- What's new in Cocoa
- Accessibility in iOS
- Building User Interfaces for iOS 7
- Getting Started with UIKit Dynamics
- What's new in Cocoa Touch
- What's New With Multitasking
- Best Practices for Cocoa Animation
- Improving Power Efficiency with App Nap
- Introducing Text Kit
@neilco
neilco / RSASHA1.swift
Created April 27, 2015 09:07
RSA-SHA1 signing with a PKCS#12 private key
//
// RSASHA1.swift
//
// Copyright (c) 2015 Neil Cowburn. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@dougalcampbell
dougalcampbell / ds-duino.ino
Created September 10, 2013 17:37
Digispark and nodejs - talking to the Digispark Arduino-compatible microcontroller via USB with the node-hid library
/*
* Accept control commands via USB.
*
* Commands start with '!' and end with '.'
* Commands have three parts: action, pin, value: !AAPPVV.
*
* E.g. '!01p101.' is DigitalWrite, Pin1, value = 1
*
* Note: This is currently *very* crude. Much improvement could be made.
* I think the use of strncpy is eating a lot of memory. Refactor?
@Hexagon
Hexagon / parametric_spacer.scad
Last active September 4, 2022 06:33
Parametric OpenSCAD distance/spacer
// ------------------------------------------------------
// User configurable parameters
// ------------------------------------------------------
spacer_height = 15; // Height in mm
m_standard_size = 4; // M-standard (M1.6 -- M16) is currently supported, 4 = M4, 1.6 = M1.6
undersize_for_threading = true; // True use the appropriate undersize for postprocessing with a tap,
// false makes a pure spacer
hex_shape = true; // True forms a hexagonal spacer(nut), false makes a round outer perimiter
wall_thickness = 3; // Indicates the maximum wall thickness in case of an