Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View NicosKaralis's full-sized avatar

Nicos Belo Karalis NicosKaralis

View GitHub Profile
#import <Foundation/Foundation.h>
@interface FileHelper : NSObject
+(NSString *) getDataFilePath;
+(NSString *) getConfigFilePath;
+(NSString *) getPlistFilePathWithName:(NSString *)name;
+(BOOL) removeFileAtPath:(NSString *)path;
@NicosKaralis
NicosKaralis / cap deploy
Created April 19, 2013 15:35
Full capistrano log
* 2013-04-19 12:30:54 executing `deploy'
triggering before callbacks for `deploy'
* 2013-04-19 12:30:54 executing `check:revision'
* 2013-04-19 12:30:54 executing `deploy:update'
** transaction: start
* 2013-04-19 12:30:54 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@bitbucket.org:nicoskaralis/wt_webapp.git dev"
command finished in 4336ms
* executing "if [ -d /home/deployer/rails_apps/webapp/shared/cached-copy ]; then cd /home/deployer/rails_apps/webapp/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 501dc00a15a9e54b9d7733770b923400760ab8a7 && git clean -q -d -x -f; else git clone -q git@bitbucket.org:nicoskaralis/wt_webapp.git /home/deployer/rails_apps/webapp/shared/cached-copy && cd /home/deployer/rails_apps/webapp/shared/cached-copy && git checkout -q -b deploy 501dc00a15a9e54b9d7733770b923400760ab8a7; fi"
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
@NicosKaralis
NicosKaralis / javascript.js
Last active December 17, 2015 07:09
Javascript sample
var marcas = new Array();var html = new Array();html.push("<table width='520' border='0' cellpadding='5' cellspacing='0' style='font-family:Helvetica, Arial, Thomas; font-size:11px; background:#fff;'><tr><td width='50' align='center' valign='top' style='border-bottom:1px solid #8a8a8a;'><img src='/templates/rmtc/images/icone-pontoparada-36.png' alt='Ponto de Parada' width='36' height='36' /></td><td width='97' align='left' valign='top' style='border-bottom:1px solid #8a8a8a;'><p style='margin:0px; padding:0px; line-height:normal;'><span style='color:#666;margin-top:1px;'>C&oacute;digo do Ponto:</span> <br /><span style='color:#263692;font-weight:bold;font-size:25px'>1431</span></p></td><td width='193' align='left' valign='top' style='border-bottom:1px solid #8a8a8a;'><p style='margin:0px; padding:0px; line-height:normal;'><span style='color:#666;margin-top:1px;'>Linhas dispon&iacute;veis: <br/><strong><a href='/linhas-e-trajetos/area-oeste/?buscar=042'>042</a>, <a href='/linhas-e-trajetos/area-oeste/?buscar=0
after "deploy:stop", "clockwork:stop"
after "deploy:start", "clockwork:start"
after "deploy:restart", "clockwork:restart"
set :clockwork_roles, :blabla
set :cw_log_file, "#{current_path}/log/clockwork.log"
set :cw_pid_file, "#{current_path}/tmp/pids/clockwork.pid"
set :rails_env, ENV['rails_env'] || ''
namespace :clockwork do
after "deploy:stop", "clockwork:stop"
after "deploy:start", "clockwork:start"
after "deploy:restart", "clockwork:restart"
namespace :clockwork do
desc "Stop clockwork"
task :stop, :roles => clockwork_roles, :on_error => :continue, :on_no_matching_servers => :continue do
run "if [ -d #{current_path} ] && [ -f #{pid_file} ]; then cd #{current_path} && kill -INT `cat #{pid
_file}` ; fi"
end
@NicosKaralis
NicosKaralis / Pseudocodigo_arduino.ino
Created July 3, 2014 18:33
Tentativa de explicar o meu problema
void setup() {
Serial.begin(9600); // Comunicação entre o pc e o arduino em 9600 bauds
Serial.println("Setup Arduino completo");
}
// Metodo para ler uma string até encontrar '/n'
int readSerialLine(char result[]) {
...
}
wget http://www1.caixa.gov.br/loterias/_arquivos/loterias/D_megase.zip -d
DEBUG output created by Wget 1.15 on darwin13.2.0.
URI encoding = “UTF-8”
--2015-01-12 15:25:41-- http://www1.caixa.gov.br/loterias/_arquivos/loterias/D_megase.zip
Resolvendo www1.caixa.gov.br (www1.caixa.gov.br)... 200.201.162.210
Caching www1.caixa.gov.br => 200.201.162.210
Conectando-se a www1.caixa.gov.br (www1.caixa.gov.br)|200.201.162.210|:80... conectado.
Created socket 3.
Releasing 0x00007ff579408a90 (new refcount 1).