Skip to content

Instantly share code, notes, and snippets.

View badpenguin's full-sized avatar
🏠
Working from home

Antonio Gallo badpenguin

🏠
Working from home
View GitHub Profile
@badpenguin
badpenguin / build.gradle
Last active February 6, 2019 19:11
snippets of android/build.gradle used to fix compilation problems with outdated subprojects in React Native 0.58.3
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android") && VersionNumber.parse(project.property("android").buildToolsVersion) < VersionNumber.parse("28.0.2")) {
def oldver = VersionNumber.parse(project.property("android").buildToolsVersion)
println ""
println "(*) UPGRADING $project.name from $oldver ..."
println ""
android {
compileSdkVersion 28
@badpenguin
badpenguin / nginx-wordpress.inc
Created July 7, 2018 18:59
Allow access to Wordpress only if user has passed thru another page first and gathered a special cookie
set $cicciopasticcio 0;
if ($request_uri ~* "/wp-admin|/wp-login.php") {
set $cicciopasticcio 1;
}
if ($request_uri ~* "/wp-admin/admin-ajax.php") {
set $cicciopasticcio 0;
}
if ($cookie_cicciopasticcio != "nginx") {
set $cicciopasticcio "${cicciopasticcio}1";
}
@badpenguin
badpenguin / gradle.properties
Last active February 20, 2018 18:17 — forked from BilalBudhani/gradle.properties
Create this file in ~/.gradle folder to speed up React Native Android building process.
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xms512m -Xmx1024m
@badpenguin
badpenguin / $log.ts
Created February 14, 2018 11:18
simple replacement for angular1 $log service - include an rxjs observable debugger and some helper for android's web apps
/*
* Antonio Gallo - https://www.antoniogallo.it - http://www.badpenguin.org/
* simple replacement for angular1 $log service
*/
// makes TS compiler happy
import {jStringify} from "./helpers";
import {Observable} from "rxjs";
declare let console: any;
" CORE
set nocompatible
set enc=utf-8
" GUI
syntax on
colorscheme pablo
" Formatting / Indent
#!/usr/bin/env bash
# Space/Tab separated list of cryptocurrencies to query
CRYPTO="BTC ETH ZEC PPC"
# Fiat separated by comma
#FIAT="EUR,USD"
#FIAT="USD"
FIAT="EUR"
@badpenguin
badpenguin / flexbox minimal grid
Created February 16, 2017 09:00
This is a Work in progress of a minimal flexbox grid
// https://css-tricks.com/snippets/css/a-guide-to-flexbox/
.flexbox-container-block {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
@badpenguin
badpenguin / helpers.ts
Created January 31, 2017 14:51
Angular2/Ionic2 Helper
import {$log} from "./$log";
import {jsObjectPrettyPrint} from "./js-object-pretty-print";
/**
* try to avoid circular references
* @param obj
* @returns {string}
*/
export function jStringify(obj) {
@badpenguin
badpenguin / Ionic2 Preloader Example index.html
Last active February 25, 2017 20:49
Ionic2 Preloader Example
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<title>Ionic App</title>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
/*
* simple replacement for angular1 $log service
* https://www.antoniogallo.it/
*/
declare var console: any;
export class $log {
static has_debug: boolean = true;