Skip to content

Instantly share code, notes, and snippets.

View Jamp's full-sized avatar

Jaro Marval Jamp

View GitHub Profile
@Jamp
Jamp / AngularJS +1.1
Created March 12, 2015 05:31
Problema con Ionic/AngularJS y FirefoxOS
var app = angular.module( 'myApp', [] ).config(['$compileProvider', function($compileProvider) {
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|app):/);
$compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|app):/);
}
]);
Ejemplo:
// Ionic Starter App
angular.module('starter', ['ionic', 'starter.controllers', 'starter.directive', 'starter.factory'])
@Jamp
Jamp / gist:d07fff4c4381859b4965
Created May 30, 2015 15:24
Angular.js equivalent $(document).ready();
angular.element(document).ready(function () {
// Do something
});
@Jamp
Jamp / gist:db9a67568c06cba29a69
Created September 8, 2015 18:33
Borrar history de Bash
cat /dev/null > ~/.bash_history && history -c && exit
@Jamp
Jamp / iptables.sh
Created October 2, 2015 11:11 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@Jamp
Jamp / preguntas.rb
Last active October 6, 2015 20:49
Juego de Preguntas Ruby
# enconding: utf-8
### Se Agregando más preguntas de forma global ###
$preguntas = [
"¿En que viaje Colón llegó a Venezuela?\nA: Primero - B: Segundo - C: Tercero - D: Cuarto",
"Cuanto es 1+1?\nA: 3 - B: 2",
"Color del Caballo Blanco del Libertador?\nA: Azul - B: Marrón - C: Blanco"
]
@Jamp
Jamp / preguntas.rb
Created October 6, 2015 21:17
Juego de Pregunta sin variables globales
# enconding: utf-8
### Se Agregando más preguntas de forma global ###
preguntas = [
"¿En que viaje Colón llegó a Venezuela?\nA: Primero - B: Segundo - C: Tercero - D: Cuarto",
"Cuanto es 1+1?\nA: 3 - B: 2",
"Color del Caballo Blanco del Libertador?\nA: Azul - B: Marrón - C: Blanco"
]
@Jamp
Jamp / script_base.sh
Last active December 11, 2015 15:37
Script Base
#!/bin/bash
#
# Script para tuneo básico de Debian Minimal
#
# Modificando Repositorios
echo '### Repositorios CANTV ###
deb http://debian.cantv.net/debian/ jessie main contrib non-free \n
deb http://security.debian.org/ jessie/updates main contrib non-free \n
@Jamp
Jamp / back.java
Created August 12, 2016 14:25
Cliquear 2 veces para salir de una aplicación
boolean doubleBackToExitPressedOnce = false;
@Override
public void onBackPressed() {
if (doubleBackToExitPressedOnce) {
super.onBackPressed();
return;
}
this.doubleBackToExitPressedOnce = true;
@Jamp
Jamp / styles.xml
Created September 19, 2016 00:01
SupportActionBar Transparent
<!-- Application theme(AppBarLayout and background color transparent). -->
<style name="Theme" parent="Theme.AppCompat.Light">
<item name="android:actionBarStyle">@style/ActionBar</item>
<item name="actionBarStyle">@style/ActionBar</item><!-- Support library compatibility -->
</style>
<!-- Style for SupportActionBar -->
<style name="ActionBar" parent="@style/Widget.AppCompat.ActionBar">
<item name="android:background">@drawable/actionbar_background</item>
<item name="android:windowActionBarOverlay">true</item>
@Jamp
Jamp / gist:f2359b8a72214a99890c447c94604d47
Created September 20, 2016 19:28
Delete ListView separator
ListView listView = (ListView) findViewById(R.id.listView);
listView.setDivider(null);
listView.setDividerHeight(0);