Skip to content

Instantly share code, notes, and snippets.

View oelna's full-sized avatar
😔
The light inside has broken, but I still work

Arno Richter oelna

😔
The light inside has broken, but I still work
View GitHub Profile
@jexchan
jexchan / Sublime Shortcuts
Last active December 19, 2015 17:18 — forked from lucasfais/gist:1207002
SublimeText Shortcuts
h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)
h2. General
| *⌘T* | go to file |
| *⌘⌃P* | go to project |
| *⌘R* | go to methods |
| *⌃G* | go to line |
| *⌘KB* | toggle side bar |
| *⌘⇧P* | command prompt |
@yellowled
yellowled / .htaccess
Created April 1, 2013 14:35
gzip aktivieren auf Uberspace
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/xhtml+xml \
application/xml \
font/opentype \
@johanhar
johanhar / uic9183aztecbarcodedecoding.m
Last active November 13, 2017 07:33
uic-918-3 aztec barcode decoding ios objective-c
// add this method to ZXAztecDecoder.m (ZXingObjC)
+ (NSString *)UIC9183TicketId:(ZXBoolArray *)correctedBits
{
NSMutableData *bytes = [[NSMutableData alloc] init];
int endIndex = (int)correctedBits.length;
ZXAztecTable latchTable = ZXAztecTableUpper; // table most recently latched to
ZXAztecTable shiftTable = ZXAztecTableUpper; // table to use for the next read
@alejandro-isaza
alejandro-isaza / String+Parsing.swift
Last active February 24, 2018 18:10
Swift Character and String extensions for parsing.
import Foundation
public extension Character {
/// Determine if the character is a space, tab or newline
public func isSpace() -> Bool {
return self == " " || self == "\t" || self == "\n" || self == "\r"
}
/// Conver the character to a UTF16 code unit
public var utf16: UInt16 {
@andreif
andreif / AppDelegate.swift
Created March 16, 2016 22:15
Example of UIPageViewController without storyboard i.e. created programmatically
// derived from https://www.veasoftware.com/posts/uipageviewcontroller-in-swift-xcode-62-ios-82-tutorial
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController()
@zwaldowski
zwaldowski / Solarized.crtheme
Created January 15, 2012 18:05
Solarized Dark for CodeRunner
<?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>BackgroundColor</key>
<string>0d2733</string>
<key>CharColor</key>
<string>cc256f</string>
<key>ClassColor</key>
<string>c1371f</string>
@nfarshchi
nfarshchi / QRScanVC.swift
Created February 19, 2018 22:12
Binary/Raw data from QR Code scanning with swift 4.0 by AVFoundation.
//
// QRScanVC.swift
//
// Created by Farshchi, Navid on 1/2/18.
//
import UIKit
import AVFoundation
class QRScanVC: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
@rasms
rasms / .htaccess
Created January 22, 2015 19:52
standard htaccess for caching and compression
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/html "access plus 1 day"
ExpiresByType text/php "access plus 1 day"
@mtttmpl
mtttmpl / relative-time.php
Created September 29, 2012 16:51
Get Relative Time in PHP (e.g. '1 hour ago', 'yesterday', 'tomorrow', 'in 2 weeks')
<?php
function time2str($ts) {
if(!ctype_digit($ts)) {
$ts = strtotime($ts);
}
$diff = time() - $ts;
if($diff == 0) {
return 'now';
} elseif($diff > 0) {
$day_diff = floor($diff / 86400);
@oelna
oelna / shortcuts.js
Last active April 10, 2022 15:06
Quick $ and $$ wrappers for querySelector
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);