Skip to content

Instantly share code, notes, and snippets.

View vital101's full-sized avatar

Jack Slingerland vital101

View GitHub Profile
@vital101
vital101 / nodegit.js
Created September 26, 2016 10:36
NodeGit Clone Private with Token
const repo = 'vital101/kernl-example-plugin-gitub';
const token = 'my-token-from-oauth';
const cloneURL = `https://${token}:[email protected]/${repository}`;
const cloneOptions = {
fetchOpts: {
callbacks: {
certificateCheck: () => { return 1; },
credentials: () => {
return NodeGit.Cred.userpassPlaintextNew(token, 'x-oauth-basic');
}
@vital101
vital101 / migrating_to_kernl.md
Created November 24, 2015 00:17
Migrating from wp-updates.com to Kernl.us

This should allow a seamless migration from WP-Updates.com to Kernl.us. This hasn't been tested yet, but I'll give it a try this week sometime and write up some documentation.

  1. Remove wp-updates code from your plugin/theme.
  2. Add Kernl update code to your plugin/theme.
  3. Upload this new version to Kernl as your initial plugin.
  4. Upload this new version to wp-updates.
  5. This should redirect all end-users to Kernl for updates seamlessly.
@vital101
vital101 / Container.htm
Created May 24, 2014 12:12
Star Wars Restoration: Main Site - Complete
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>Star Wars</title>
<bgsound src="STARWARS.mid" loop="1"></bgsound>
</head>
<frameset framespacing="0" border="false" frameborder="0" cols="197,*">
<frame name="starmenu" target="starwars" src="./Star Wars_files/starmenu.html" scrolling="auto" noresize="">
<frame name="starwars" src="./Star Wars_files/starwars.html" target="_top" scrolling="auto" noresize="">
@vital101
vital101 / LeftFrame.html
Created May 23, 2014 11:36
Star Wars Restoration: Main Site
<!-- saved from url=(0097)https://web.archive.org/web/20010811043323fw_/http://my.voyager.net/~hands/star-wars/starmenu.htm -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="analytics.js"></script><style type="text/css"></style>
<link type="text/css" rel="stylesheet" href="banner-styles.css">
var logger = function(req, res, next) {
console.log(req);
next();
};
app.configure(function() {
app.user(logger);
});
@vital101
vital101 / gil_test.rb
Created November 20, 2012 20:59
Ruby GIL Test Program
# Given the word list, count how many words are in the dictionary.
# Note: This isn't the most efficient way to do thise. If I was going for
# speed, I would have made each dicitonary word the key of a hash, and
# had O(n) lookup times.
def process_words(words, dictionary)
puts "Starting thread #{Thread.current.object_id}\n"
found = 0
words.each do |word|
if dictionary.include? word
def run(self, edit):
urls = []
selections = self.view.sel()
for selection in selections:
urls.append(self.view.substr(selection))
messages = self.validate_urls(urls)
self.show_quick_panel(messages, self.view.window())
def show_quick_panel(self, messages, window):
def validate_urls(self, urls):
messages = []
for url in urls:
try:
request = urllib2.Request(url, headers={ "User-Agent" : "Sublime URL Checker" })
response = urllib2.urlopen(request, timeout=3)
message = '"%s" is a valid URL.' % url
except Exception as (e):
message = '"%s" is an invalid URL.' % url
@vital101
vital101 / gist:3920122
Created October 19, 2012 19:18
Sublime Text 2 Plugin: Hello World
urls = []
selections = self.view.sel()
for selection in selections:
urls.append(self.view.substr(selection))
messages = self.validate_urls(urls)
@vital101
vital101 / Default.sublime-commands
Created October 19, 2012 15:19
Sublime Text 2 Plugin: Hello World
[{
"id": "checkurls",
"caption": "Check Urls",
"command": "check_urls"
}]