Skip to content

Instantly share code, notes, and snippets.

View tib's full-sized avatar
🪶
Just flying around...

Tibor Bödecs tib

🪶
Just flying around...
View GitHub Profile
@chrisle
chrisle / gist:2252209
Created March 30, 2012 15:15
CURL as GoogleBot 2.1
curl --user-agent "Googlebot/2.1 (+http://www.google.com/bot.html)" -v $@
@brovador
brovador / Xcodeproj_add_framework.rb
Last active May 20, 2016 22:22
An extension of Xcodeproj::Project to add frameworks directly to a project
require 'xcodeproj'
# Based on: http://blog.seiji.me/2012/02/10/create-xcodeproj-using-xcode-project/
# example usage
# project.add_system_framework("Foundation.framework")
# project.add_system_framework("libxml2.dylib")
module Xcodeproj
class Project
def add_system_framework(fname)
@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@devgru
devgru / canvas.js
Last active January 4, 2021 16:42
High DPI Canvas (Retina support)
var width = 500,
height = 70,
font = '18px serif'
function getRetinaRatio() {
var devicePixelRatio = window.devicePixelRatio || 1
var c = document.createElement('canvas').getContext('2d')
var backingStoreRatio = [
c.webkitBackingStorePixelRatio,
c.mozBackingStorePixelRatio,
#!/usr/bin/env xcrun swift
import Foundation
let kDelayUSec : useconds_t = 500_000
func DragMouse(from p0: CGPoint, to p1: CGPoint) {
let mouseDown = CGEventCreateMouseEvent(nil, .LeftMouseDown, p0, .Left)
let mouseDrag = CGEventCreateMouseEvent(nil, .LeftMouseDragged, p1, .Left)
let mouseUp = CGEventCreateMouseEvent(nil, .LeftMouseUp, p1, .Left)
@eyecatchup
eyecatchup / apple-meta-insanity.html
Created February 8, 2015 12:28
Insanity of Apple-specific meta tags..
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Apple Meta Insanity</title>
<!--
APPLE WEB APP META TAGS
-->
@craiggrummitt
craiggrummitt / SKTexture gradient extension
Last active April 29, 2019 09:47
SKTexture gradient extension
//
// Extensions.swift
// WordSnatch
//
// Created by Craig on 24/03/2015.
// Copyright (c) 2015 Interactive Coconut. All rights reserved.
//
import SpriteKit
import UIKit
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@aclissold
aclissold / NSUserDefaults+UIColor.swift
Created June 1, 2015 14:52
Swift NSUserDefaults UIColor extension
extension NSUserDefaults {
func colorForKey(key: String) -> UIColor? {
var color: UIColor?
if let colorData = dataForKey(key) {
color = NSKeyedUnarchiver.unarchiveObjectWithData(colorData) as? UIColor
}
return color
}