Skip to content

Instantly share code, notes, and snippets.

View patoroco's full-sized avatar
:octocat:
why do we need status in Github?

Jorge Maroto patoroco

:octocat:
why do we need status in Github?
View GitHub Profile
@vivirenremoto
vivirenremoto / gist:5052719
Last active December 14, 2015 07:48
Detecta el dispositivo móvil y redirige a su versión correspondiente con un sólo código QR
<?php
$user_agent = $_SERVER['HTTP_USER_AGENT'];
switch( true ){
case preg_match('/iphone|ipad/si',$user_agent):
$url = 'https://itunes.apple.com/us/app/whatsapp-messenger/id310633997?mt=8';
break;
case stristr($user_agent, 'android'):
@kennedyj
kennedyj / Default (Linux).sublime-keymap
Created September 5, 2012 18:52 — forked from coldnebo/Default (Linux).sublime-keymap
simple scripts to prettify your xml and json in sublime text 2
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
@frr149
frr149 / gist:3436544
Created August 23, 2012 13:21
Mandelbrot
-(void)generateImageOfSize:(CGSize)imageSize
{
// Determine integer size of image
NSInteger imageIntWidth = ceilf(imageSize.width);
NSInteger imageIntHeight = ceilf(imageSize.height);
// Determine coordinate maxima
assert(zoomFactor > 0.0f);
float coordMaxX = coordMinX + imageIntWidth / zoomFactor;
float coordMaxY = coordMinY + imageIntHeight / zoomFactor;
@0xced
0xced / XCDFakeCarrier.m
Last active March 5, 2023 22:07
Hack to choose the displayed carrier name in the iOS simulator
//
// Copyright (c) 2012-2015 Cédric Luthi / @0xced. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_OS_SIMULATOR
static const char *fakeCarrier;
static const char *fakeTime;
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active August 25, 2025 12:52 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

CIAdditionCompositing - Adds color components to achieve a brightening effect. This filter is typically used to add highlights and lens flare effects.
CIAffineClamp - Performs an affine transform on a source image and then clamps the pixels at the edge of the transformed image, extending them outwards. This filter performs similarly to the CIAffineTransform filter except that it produces an image with infinite extent. You can use this filter when you need to blur an image but you want to avoid a soft, black fringe along the edges.
CIAffineTile - Applies an affine transform to an image and then tiles the transformed image.
CIAffineTransform - Applies an affine transform to an image. You can scale, translate, or rotate the input image. You can also apply a combination of these operations.
CIAreaAverage - Calculates the average color for the specified area in an image, returning the result in a pixel.
CIAreaHistogram - Calculates a histogram for the specified area in an image, returning the result in a 1D image.