Skip to content

Instantly share code, notes, and snippets.

View 19WAS85's full-sized avatar

Wagner Andrade 19WAS85

  • Porto Alegre, RS, Brazil
View GitHub Profile
@19WAS85
19WAS85 / index.html
Last active January 18, 2018 13:21
Google Maps Animated Custom Icon/Mark
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<style>
#map { height: 400px; width: 100% }
#giftLayer img { display: none }
</style>
</head>
<body>
@19WAS85
19WAS85 / array-test.js
Last active August 29, 2015 14:19
Proof of concept: abbreviating mocha tests with specify
var should = require('chai').should();
var specify = require('./specify').create(it);
// ------------------------
// ARRAY TEST TRADITIONAL
// ------------------------
describe('Array (traditional)', function(){
var array = [1, 2, 3];
@19WAS85
19WAS85 / data-async.js
Last active December 29, 2015 13:09
jquery data-async attribute support
$(function () {
$('*[data-async="true"]').each(function () {
var self = $(this);
if (self.data('handled') != null) return;
var events = self.data('events') || 'click';
self.bind(events, function (e) {
var preventDefault = self.data('prevent-default');
if (preventDefault == 'true') e.preventDefault();
var confirmMessage = self.data('confirm');
@19WAS85
19WAS85 / .init.light.vim
Last active December 11, 2023 20:55
~/.config/nvim/init.vim
" buffers
map <Tab> :bn!<CR>
map <S-Tab> :bp!<CR>
map <S-q> :bw<CR>
" search
map <C-k> :noh<CR>
" disable page up down
map <PageUp> <nop>
(function(){var a=Array.prototype.slice;var b=a.call(document.getElementsByTagName('img'));var c=a.call(document.getElementsByTagName('iframe'));var d=a.call(document.getElementsByTagName('object'));var e=b.concat(c).concat(d);for(var i=0;i<e.length;i++){e[i].style.visibility='hidden'};var f=document.getElementsByTagName('*');for(var i=0;i<f.length;i++){var g=f[i].attributes.style;var h=g?g.value+';':'';f[i].setAttribute('style',h+'background-image: none !important')};return false})();
@19WAS85
19WAS85 / PersistentList.cs
Last active December 17, 2015 07:09
File persistent list.
public class PersistentList<T> : IList<T>
{
private static readonly object locker = new object();
private List<T> memoryList;
public PersistentList() : this(null) { }
public PersistentList(string filePath)
{
FilePath = filePath ?? String.Concat(Path.GetTempPath(), typeof(T).Name, ".list");
@19WAS85
19WAS85 / powershell-web-server.ps1
Last active November 4, 2024 16:50
A simple web server built with powershell.
# This is a super **SIMPLE** example of how to create a very basic powershell webserver
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity.
# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
# Start the Http Server
@19WAS85
19WAS85 / Github.StorableColorTheme.xml
Created April 20, 2013 02:11
Windows PowerShell ISE Github Theme.
<?xml version="1.0" encoding="utf-16"?>
<StorableColorTheme xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Keys>
<string>ErrorForegroundColor</string>
<string>ErrorBackgroundColor</string>
<string>WarningForegroundColor</string>
<string>WarningBackgroundColor</string>
<string>VerboseForegroundColor</string>
<string>VerboseBackgroundColor</string>
<string>DebugForegroundColor</string>
@19WAS85
19WAS85 / load-packages.ps1
Last active September 29, 2022 22:22
Loads all assemblies (dlls) in 'packages' directory. Useful to work with nuget.
function Load-Packages
{
param ([string] $directory = 'Packages')
$assemblies = Get-ChildItem $directory -Recurse -Filter '*.dll' | Select -Expand FullName
foreach ($assembly in $assemblies) { [System.Reflection.Assembly]::LoadFrom($assembly) }
}
@19WAS85
19WAS85 / notepad.html
Last active September 29, 2022 22:21
Put the content of release.html file into your address bar... Now you have a (salvable and editable) notepad in your browser!
data:text/html,
<!DOCTYPE html>
<html>
<head>
<title>Notepad</title>
<link rel="shortcut icon" href="http://www.veryicon.com/icon/16/Application/App/notepad.png" />
<script>
function onBodyLoad() {
document.body.addEventListener('DOMSubtreeModified', function () {