Skip to content

Instantly share code, notes, and snippets.

View coudron's full-sized avatar

Chris Coudron coudron

  • San Francisco, CA, USA
View GitHub Profile
@coudron
coudron / ExampleInstructionBuilder.js
Created April 10, 2022 02:30
Example of new Anchor method builder
transaction.add(
await program.methods
.createNewAmazingAccount(
new BN(250), // some args to pass in
)
.accounts({
someAccount: someAccountPublicKey,
someAccount: someAccountPublicKey,
})
.instruction() // or .rpc() or .simulate() etc.
@coudron
coudron / ush.json
Last active March 29, 2022 01:44
USH metadata
{
"name": "Some Test Token",
"symbol": "FOO",
}
@coudron
coudron / gcode settings
Created March 17, 2018 03:08
TEVO Little Monster Cura Settings
Start GCode:
M280 S10.6
G28
M280 S3
G1 Z50 F25000
G30 Z0.2 ; My Nozzle high
M280 S7 ; Lift BL Sensor
G1 X0 Y0 Z100 ; lift nozzle
M42
@coudron
coudron / keymap.cson
Last active January 18, 2017 21:28
Atom Keymap File
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
{
"websocket_server": false,
"heartbeat_threshold": 10,
"enable_social": true,
"live_config_update": {
"enabled": false,
"tasks_only": false
},
"tasks": [
{
@coudron
coudron / .slate.js
Last active July 11, 2016 17:50
Slate config file
var current_position = 0;
var pushLeft = slate.operation("move", {
"x": "screenOriginX",
"y": "screenOriginY",
"width": "screenSizeX/2",
"height": "screenSizeY"
});
var pushRight = slate.operation("move", {
@coudron
coudron / Chalkboard.terminal
Last active December 4, 2016 04:57 — forked from thauber/gist:4264360
Some of my bash settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NGMCAw
IDAAEAKAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVj
dF8QD05TS2V5ZWRBcmNoaXZlctEXGFRyb290gAEIERojLTI3O0FITltiaWttcn2GjpGa
@coudron
coudron / view.py
Last active May 20, 2016 20:58
Python and Objective-C code that enables an iOS app to upload images directly to an S3 bucket using a secure authorization header generated by a python server Code is a Fork from Stackoverflow answer: http://stackoverflow.com/questions/4481311/architectural-and-design-question-about-uploading-photos-from-iphone-app-and-s3 Let me know what you th…
- (void)uploadImage:(UIImage *)image
{
//Set up the upload request from our server
NSURL *url = [NSURL URLWithString:@"http://<your-server-url-here>/"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
// Pull out any required information out of the response
NSString *serverDate = [JSON valueForKeyPath:@"date_string"];