Skip to content

Instantly share code, notes, and snippets.

View gist:76ecd5b5833f10ae10c8
var asnaHelper = asnaHelper || {};
asnaHelper.getGeoLocationManager = function() {
var counter = 0;
var showGeoWatcherCaptureToConsole = true;
var captureSecondsInterval = 1000 * 10; // 10 second default capture interval.
var watcher;
var currentPosition = {
"latitude": 0,
"longitude": 0
@rogerpence
rogerpence / gist:8b55bef13db273c7bffa71d0d6f9cc84
Last active January 10, 2019 18:22
An old regex article
View gist:8b55bef13db273c7bffa71d0d6f9cc84
<p>Regular expressions (regex) provide a pattern matching scheme you can use to search and manipulate&nbsp;strings. Although regex has been around for almost 50 years, it is often either completely ignored or relegated to the &ldquo;will learn later&rdquo; pile by many programmers. Regex is indeed borderline witchcraft that at first glance looks like it was culled from the script of <a href="https://www.youtube.com/watch?v=Ln7WF78PolA">Plan 9 from Outer Space</a>. (It wasn&rsquo;t!).</p>
<p>There is an old programming adage that goes: &ldquo;One time I had a problem so I tried to solve it with regular expressions. Now I have two problems.&rdquo; If you&#39;re not careful, that old saying sums up regex well. If you get in a hurry&nbsp;or try to over-complicate things, regex will get you in more trouble than cheating on your taxes. But with a little effort and practice, knowing how and when to use a regular expression to solve a problem will make your code better, easier to read (really!), and easier to maintai
@rogerpence
rogerpence / showtime.aspx
Created November 7, 2016 21:08
show time asp.net
View showtime.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
@rogerpence
rogerpence / firstrpg.rpg
Created November 10, 2016 20:57
MR free format HelloRPG
View firstrpg.rpg
Ctl-Opt Option(*srcstmt) Dftactgrp(*No) ActGrp('rpmobile');
Dcl-F First WORKSTN Handler('MOBILERPG');
ExFmt HOMEMENU;
Select;
When *In03;
*InLR = *On;
Return;
@rogerpence
rogerpence / gist:bbbb5bb87fc55da5dee654b2ec649f98
Created January 13, 2019 19:26
Emmet to generate a bunch of <li> tags
View gist:bbbb5bb87fc55da5dee654b2ec649f98
ul.section>(li.section-item{item$})*16
produces:
<ul class="section">
<li class="section-item">item1</li>
<li class="section-item">item2</li>
<li class="section-item">item3</li>
<li class="section-item">item4</li>
<li class="section-item">item5</li>
@rogerpence
rogerpence / gist:749dbf915ab45796a47286c9e7a17d07
Created February 7, 2019 04:13
nVidia video card problem when reinstalling Ubuntu on Bonobo
View gist:749dbf915ab45796a47286c9e7a17d07
For fresh install
To get to boot menu, press Shift during boot
During get to Ubuntu screen to be able to enter commands with
Add this line to avoid nVidia video card problem
nouveau.modeset=0
https://community.linuxmint.com/tutorial/view/842
After installing Ubuntu 16.04 but before adding System 76-specific stuff and nVidia drives, my mouse worked but the
mouse cursor wasn't visible. If this is the case, use Ctrl/Alt T to bring a terminal window to install the
System 76-specific stuff and the nVidia drivers.
@rogerpence
rogerpence / gist:41616ea91b1c32db5764a6d7361fa653
Created February 7, 2019 04:14
System 76 Bonobo NVidia Ubuntu installation problem
View gist:41616ea91b1c32db5764a6d7361fa653
For fresh install
To get to boot menu, press Shift during boot
During get to Ubuntu screen to be able to enter commands with
Add this line to avoid nVidia video card problem
nouveau.modeset=0
https://community.linuxmint.com/tutorial/view/842
After installing Ubuntu 16.04 but before adding System 76-specific stuff and nVidia drives, my mouse worked but the
mouse cursor wasn't visible. If this is the case, use Ctrl/Alt T to bring a terminal window to install the
System 76-specific stuff and the nVidia drivers.
@rogerpence
rogerpence / index.html
Last active February 15, 2019 18:45
Notifier skeleton
View index.html
<div class='container'>
<a id="clicker" href="#">Add a note</a>
</div>
<div class="notes-container">
<div class="note n1">Note 1</div>
<div class="note n2">Note 2</div>
<div class="note n3">Note 3
<a id="n3-click" href="#">Click</a>
</div>
View gist:189c2af069225bd8907e52551edb627c
Replaces lines 119 through 125
applyCrierAttributes(crierElement, crierInfo, options) {
crierElement.style.position = 'static';
crierElement.style.height = `${crierInfo.height}px`;
crierElement.setAttribute('data-height', `${crierInfo.height}px`);