Skip to content

Instantly share code, notes, and snippets.

View joaoBeno's full-sized avatar
💭
I may be slow to respond.

joaoBeno

💭
I may be slow to respond.
View GitHub Profile
var minha_var = '';
function funcao_enrolada(parametro,callback) {
var resultado = $.qlqrcoisa (parametro,function(resposta){
callback(resposta);
});
}
funcao_enrolada("50",function(param){
@joaoBeno
joaoBeno / sampleViewController.m
Created November 11, 2015 02:33
Setar bordas customizadas no botão...
UIBezierPath *shapePathFB = [UIBezierPath bezierPathWithRoundedRect:self.btnSampleOutlet.bounds
byRoundingCorners:UIRectCornerTopRight | UIRectCornerBottomRight
cornerRadii:CGSizeMake(7.0, 7.0)];
CAShapeLayer *shapeLayerFB = [CAShapeLayer layer];
shapeLayerFB.frame = self.btnSampleOutlet.bounds; // Why set bounds? My btn has bounds already...
shapeLayerFB.path = shapePathFB.CGPath;
shapeLayerFB.fillColor = [UIColor clearColor].CGColor;
shapeLayerFB.strokeColor = [UIColor blackColor].CGColor;
shapeLayerFB.lineWidth = 1;
@joaoBeno
joaoBeno / mysql_util.sql
Created November 15, 2015 05:19
Some util mysql snippets
SELECT COUNT(id) AS total,`name` FROM table
GROUP BY `name` HAVING (total > 1)
@joaoBeno
joaoBeno / gist:c4730205580569ab1102db42392b05eb
Created May 21, 2016 10:08
How to circumvent slow as hell Mac App Store dowload...
So, you have a somewhat fast connection, but Apple decided you should have the latest Os X (Or some other app) in 3 days?
Let's change that!
The idea is simply to get the Apple download URL, download the file using some download accelerator, then fake the server on localhost
so App Store download it from your computer instead of the internet!
So, now the instructions (That I found over here: https://7labs.heypub.com/tips-tricks/el-capitan-direct-download.html):
1) Open App Store, then go to the app you wish to download, let the screen there and open a terminal window
2) Type the command below to open your computer's host files (This files store a sort of list relating ip's to domains)
sudo nano /etc/hosts
@joaoBeno
joaoBeno / jsf.md
Created August 10, 2016 11:15 — forked from nekman/jsf.md
Don't use JSF

JSF?!

http://www.thoughtworks.com/radar/#/languages-and-frameworks/683 - ThoughtWorks Technology Radar - January 2014

We continue to see teams run into trouble using JSF -- JavaServer Faces -- and are recommending you avoid this technology. Teams seem to choose JSF because it is a J2EE standard without really evaluating whether the programming model suits them. We think JSF is flawed because it tries to abstract away HTML, CSS and HTTP, exactly the reverse of what modern web frameworks do. JSF, like ASP.NET webforms, attempts to create statefulness on top of the stateless protocol HTTP and ends up causing a whole host of problems involving shared server-side state. We are aware of the improvements in JSF 2.0, but think the model is fundamentally broken. We recommend teams use simple frameworks and embrace and understand web technologies including HTTP, HTML and CSS.


http://www.jfokus.se/jfokus/talks.jsp - Search for JSF... (one hit on why you should leave it)
http://architecture-musings.blo
#include <stdio.h>
int main() {
exercicio_pick:
{
int exercicio;
printf("Selecione o execicio do dia 09/10:\n");
scanf("%i", &exercicio);
@joaoBeno
joaoBeno / apple-touch-startup-image.html
Last active October 16, 2019 17:45 — forked from EvanBacon/apple-touch-startup-image.html
An example of full iOS PWA startup image (splash screen) support.
<html>
<head>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-title" content="Expo" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link
rel="apple-touch-icon"
sizes="180x180"
@joaoBeno
joaoBeno / exercicio_ponteiros.c
Created October 29, 2019 23:57
Exercicio ponteiros
#include <stdio.h>
void troca(float *a, float *c, float *b);
int main() {
float x, y, z;
printf("Digite os numeros:\n");
scanf("%f,%f,%f", &x, &y, &z);
@joaoBeno
joaoBeno / exercicio_min_max.c
Created October 30, 2019 00:40
Exercicio minimo maximo
#include <stdio.h>
void maximoMinimo(int *v, int N, int *maximo, int *minimo);
int main() {
int t = 4;
int vt[4] = {2,3,4,5};
int max, min;
maximoMinimo(&vt, t, &max, &min);