Skip to content

Instantly share code, notes, and snippets.

View koke's full-sized avatar

Jorge Bernal koke

View GitHub Profile
@Adam-Clrk
Adam-Clrk / cloud-init.yaml
Last active February 6, 2024 20:12
Minecraft server cloud-init
#cloud-config
users:
- default
- name: minecraft
ssh_import_id: gh:adam-clrk
gecos: Minecraft server user
lock_passwd: true
#sudo: ALL=(ALL) NOPASSWD:ALL
package_update: true
package_upgrade: true
@artpi
artpi / btc-eth-dca-buy.php
Last active October 14, 2021 16:39 — forked from levelsio/btc-eth-dca-buy.php
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
<?php
// Forked from @levelsio
function generateBitstampSignature( $nonce ) {
$message = $nonce . BITSTAMP_ID . BITSTAMP_KEY;
return strtoupper( hash_hmac( 'sha256', $message, BITSTAMP_SECRET ) );
}
@xtravar
xtravar / Creatable.md
Last active February 29, 2016 16:33
Creatable Swift extension

The Problem

I really like setting properties in their declaration line. It just feels so good to leverage Swift's let.

The drawback is that you must then set properties' properties in init, somewhat splitting the "setup" into two stages and mixing it with the "usage".

    public class MyView : UIView {
        private let titleLabel = UILabel()
 
#import <Foundation/Foundation.h>
typedef void (^measurable)();
const NSString *Target = @"http://jetpack-test.koke.me";
NSUInteger SiteID = 90752579;
NSString *Payload;
NSString *Alphabet = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
double measure(measurable action) {
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// [email protected]
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>