Skip to content

Instantly share code, notes, and snippets.

View cbueno's full-sized avatar

Cristóferson Bueno cbueno

  • Atlants Animes
  • Belo Horizonte, Brasil
  • X @cbueno
View GitHub Profile
@uniomni
uniomni / gist:779194
Created January 14, 2011 04:56
Geoserver REST command examples

REST commands, generated by Risk-in-a-Box and known to work

Upload shapefile + associated style. Then activate style and make it default.

PUT -H "Content-type: application/zip" "http://localhost:8080/geoserver/rest/workspaces/exposure/datastores/AIBEP_schools/file.shp" --data-binary "@AIBEP_schools.zip"
POST -H "Content-type: text/xml" "http://localhost:8080/geoserver/rest/styles" --data-ascii "<style>AIBEP_schoolsAIBEP_schools.sld</style>"
PUT -H "Content-type: application/vnd.ogc.sld+xml" "http://localhost:8080/geoserver/rest/styles/AIBEP_schools" --data-binary "@AIBEP_schools.sld"
PUT -H "Content-type: text/xml" "http://localhost:8080/geoserver/rest/layers/AIBEP_schools" --data-ascii "AIBEP_schoolstrue"

@brianleroux
brianleroux / phonegap-pyside.py
Created April 11, 2011 20:07
A quick, rather goofy, desktop WebKit wrapper w/ Qt/Pyside.
#! /usr/bin/env python
import sys
import os
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtWebKit import *
app = QApplication(sys.argv)
app.setQuitOnLastWindowClosed(True)
@erans
erans / UIImage+Resize.m
Created November 7, 2011 07:10
UIImage+Resize.m Fix for Rotation / Orientation on iOS 5
- (UIImage *)resizedImage:(CGSize)newSize interpolationQuality:(CGInterpolationQuality)quality {
BOOL drawTransposed;
CGAffineTransform transform = CGAffineTransformIdentity;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0) {
// Apprently in iOS 5 the image is already correctly rotated, so we don't need to rotate it manually
drawTransposed = NO;
} else {
switch (self.imageOrientation) {
case UIImageOrientationLeft:
@mediabounds
mediabounds / floatsign.sh
Last active January 13, 2025 15:25
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@navinpai
navinpai / convert.bat
Created November 23, 2011 16:14
Convert M4A to MP3 With VLC
@ECHO OFF
REM Use this to convert m4a's to mp3's using VLC (http://www.videolan.org/vlc/).... Had to find this to convert songs
REM downloaded with https://github.com/navinpai/8Tracks-Downloader :P :)
:START
FOR /R %%G IN (*.m4a) DO (CALL :SUB_VLC "%%G")
FOR /R %%G IN (*.m4a.mp*) DO (CALL :SUB_RENAME "%%G")
FOR /R %%G IN (*.m4a) DO (del "%%G")
sleep 1000
GOTO :START
GOTO :eof
@andyburke
andyburke / facebook-photo-post-javascript.js
Created December 19, 2011 20:37
How to post a photo to Facebook from client-side Javascript
// This bit is important. It detects/adds XMLHttpRequest.sendAsBinary. Without this
// you cannot send image data as part of a multipart/form-data encoded request from
// Javascript. This implementation depends on Uint8Array, so if the browser doesn't
// support either XMLHttpRequest.sendAsBinary or Uint8Array, then you will need to
// find yet another way to implement this. (This is left as an exercise for the reader,
// but if you do it, please let me know and I'll integrate it.)
// from: http://stackoverflow.com/a/5303242/945521
if ( XMLHttpRequest.prototype.sendAsBinary === undefined ) {
@sadache
sadache / Application.scala
Created May 17, 2012 08:26
Play2: Stream results of parallel jobs as comet to the client
package controllers
import play.api._
import play.api.mvc._
object Application extends Controller {
def index = Action {
@isutton
isutton / main.m
Created July 9, 2012 08:51
Regular expressions in Objective-C
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
NSString *key = @"UINavigationBarTintColor";
NSString *pattern = @"(Color|Font|Height|Width|Size|Origin|Frame)$";
@cbueno
cbueno / MIT-LICENSE.txt
Created September 24, 2012 16:27
EN: Objective-C class for validate CPF number / PT-BR: Classe em Objective-C para validação de CPF
Copyright (C) 2012 Cristóferson Bueno
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE U
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007