Skip to content

Instantly share code, notes, and snippets.

@gadmyth
gadmyth / ViewController.m
Last active July 10, 2017 11:26
AnchorPoint test
//
// ViewController.m
// AnchorPointTest
//
// Created by gadmyth on 7/10/17.
// Copyright © 2017 gadmyth. All rights reserved.
//
#import "ViewController.h"
@gadmyth
gadmyth / ViewController.m
Created July 10, 2017 11:25
AnchorPoint test
//
// ViewController.m
// AnchorPointTest
//
// Created by gadmyth on 7/10/17.
// Copyright © 2017 39sports. All rights reserved.
//
#import "ViewController.h"
#import <Foundation/Foundation.h>
struct __block_impl;
struct __block_impl_0;
struct __Block_byref_happy_0 {
void *__isa;
__Block_byref_happy_0 *__forwarding;
int __flags;
int __size;
#import <Foundation/Foundation.h>
struct __block_impl;
struct __block_impl_0;
struct __block_impl {
void *isa;
int Flags;
int Reserved;
void (*FuncPtr)(__block_impl_0 *);
@gadmyth
gadmyth / text size
Created September 29, 2014 18:28
android set text size in code
public class TestActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.i("TestActivity", "onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
TextView view = (TextView) findViewById(R.id.test_size);
int size = getResources().getDimensionPixelSize(R.dimen.test_text_size);
@gadmyth
gadmyth / gist:53123f030b6161dca116
Created September 27, 2014 16:04
Number-mode not scale (using ov instead of text-scale)
(require 'ov)
(defun ov-double-height ()
(interactive)
(ov (point-min) (point-max) '(face (:height 1.25))))
(defun ov-half-height ()
(interactive)
(ov (point-min) (point-max) '(face (:height 0.8))))
(defun ov-reset-height ()
(interactive)
(ov-clear))
(defun pairs (x)
(labels ((pair-from-list (lst cum)
(let ((a (car lst)) (b (cadr lst)) (new-lst (cddr lst)))
(if (or (null a) (null b))
(reverse cum)
(progn
(pair-from-list new-lst (pushnew `(,a . ,b) cum)))))))
(pair-from-list x nil)))