Skip to content

Instantly share code, notes, and snippets.

View akobashikawa's full-sized avatar

Antonio Kobashikawa akobashikawa

View GitHub Profile
@akobashikawa
akobashikawa / gist:e29caee5e31bdbfa712c
Last active August 29, 2015 14:21
Django tag to publish some settings value in template
# based upon ideas in http://stackoverflow.com/a/6343321
@register.simple_tag(takes_context=True)
def settings_value(context, name):
PUBLIC_SETTINGS_NAMES = ("THEME_DEBUG",)
if name in PUBLIC_SETTINGS_NAMES:
context[name] = getattr(settings, name, "")
return ''
return ''
@akobashikawa
akobashikawa / gist:7569706182654ae5f00f
Created May 15, 2015 16:05
Django tag to publish context value in templates
# Use: {% set_context_value "varname" value %}
@register.simple_tag(takes_context=True)
def set_context_value(context, name, value):
context[name] = value
return ''
@akobashikawa
akobashikawa / tipodecambio.html
Created August 17, 2015 20:42
Obteniendo el tipo de cambio desde la web de "El peruano"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tipo de Cambio</title>
</head>
<body>
<h1>Tipo de Cambio</h1>
<p id="result">Cargando...</p>
<p><small>Tomado de: http://www.elperuano.com.pe/edicion/</small></p>
@akobashikawa
akobashikawa / ShowPass
Created March 28, 2016 02:15
Bookmark to show passwords in current page
javascript:%5B%5D.forEach.call(%20document.querySelectorAll(%27input%5Btype%3D%5C%27password%5C%27%5D%27),%20function(v,i)%7Bv.setAttribute(%27type%27,%20%27text%27)%3B%7D%20)%3B
<script src="http://dev.videocheckout.com:/js/embed-script-popbox.js"></script>
<script src="http://dev.videocheckout.com:/js/embed-script.js"></script>
<style>@import "http://dev.videocheckout.com:/css/embed-script-popbox.css"</style>
<div class="vco-modal">
<div id="vco-modal-58261014a1dda9000432e215" class="vco-modalbg" data-id="58261014a1dda9000432e215" >
<div class="vco-dialog">
<a id="vco-close-58261014a1dda9000432e215" href="#close" title="Close" class="vco-close" data-id="58261014a1dda9000432e215">&#10006;</a>
</div>
</div>
<a href="#vco-modal-58261014a1dda9000432e215" class="vco-button" data-url="https://dev-vcvideoplayer.herokuapp.com/58261014a1dda9000432e215l=false&embed=true" data-id="58261014a1dda9000432e215">
@akobashikawa
akobashikawa / ping-test-ifchanges-host.js
Last active December 13, 2017 17:36
Internet test with ping in NodeJS
const ping = require('ping');
let host = '8.8.8.8';
if (process.argv[2]) {
host = process.argv[2];
} else {
console.log("Syntax: \nnode ping-test-ifchanges-host host");
}
@akobashikawa
akobashikawa / Program.cs
Created December 13, 2017 22:42
.NET HelloWorld
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Your name?");
string name = Console.ReadLine();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Decision Tree</title>
</head>
<body>
<ul id="tree"></ul>
@akobashikawa
akobashikawa / d3-manual-pie.html
Created November 2, 2018 22:46
learning d3 - manual pie
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Manually Pie</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style>