Skip to content

Instantly share code, notes, and snippets.

View crazyquark's full-sized avatar

Cristian Sandu crazyquark

View GitHub Profile
@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
@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?
@eternalstorms
eternalstorms / Apple Evangelists.txt
Created June 12, 2013 09:07
Apple Evangelists (WWDC 2013)
UI- and App Frameworks Evangelist - Jake Behrens, [email protected], 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
@alphazo
alphazo / gist:3303282
Created August 9, 2012 11:03
Clone MiFare cards using chinesse UUID writable cards

libnfc supports UUID writable cards and even has some dedicated tools for them.

However it doesn't work with some of the cards found on eBay that are even simpler to use. Sector 0 is unlocked and can be written without any additional commands. libnfc requires a small patch to get it working.

Following has been tested under ArchLinux with modified libnfc 1.5.1, mfoc 0.10.2 and a SCL3711 dongle.

Patch & recompile libnfc

The patch is fairly simple, open libnfc-1.5.1/utils/nfc-mfclassic.c and comment 2 lines (it was lines 384 and 385 for me):

// Try to write the trailer

@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 {
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@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])