Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Guaranteed to work behind the scenes, so you don't have to!

Victor Yap starlocke

:shipit:
Guaranteed to work behind the scenes, so you don't have to!
View GitHub Profile
View challenge.js
let http = require('http');
(function follow(url){
url = url.indexOf('?') !== -1 ? url.replace(/\?/,'.json?') : url + '.json';
http.get(url, response => {
let rawData = '';
response.on('data', data => {
rawData += data;
});
response.on('end', data => {
@starlocke
starlocke / confluence.css
Created Apr 22, 2021
Confluence and JIRA UI/UX upgrades
View confluence.css
/* Headlings become far more distinct, when viewing pages */
#main-content h1 {
font-family: 'Victor Mono', monospace;
color: crimson;
}
#main-content h2 {
font-family: 'Victor Mono', monospace;
font-style: italic;
font-weight: bold;
@starlocke
starlocke / auto_translate.js
Created Feb 13, 2017
#Twitter {Auto-Translate} {You can have this.}
View auto_translate.js
/**
* 1. Install "CJS" (Custom JavaScript for Web) Extension for your
* https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija
* 2. Apply the following snippet for the host "https://twitter.com"
* 3. Save
*/
var auto_translate = function(){
$('button.translate-button:visible').click();
};
@starlocke
starlocke / lockon
Created Feb 11, 2016
Small python script template to get current system to lock on to a particular load balance server; must be customized for target hosts
View lockon
#!/usr/bin/python
import os
import sys
if len(sys.argv) < 2:
print 'Usage: load [a|b|c]'
raise SystemExit()
if sys.argv[1] == 'a':
@starlocke
starlocke / google_analytics_experiment_snippet.js
Created Jan 7, 2016
Marketo-oriented Google Analytics Content Experiment Code
View google_analytics_experiment_snippet.js
<!-- Google Analytics Content Experiment code // On-Off controlled by server-side logic -->
<script>
document.ga_exp_key = ''; // Server-side logic will be responsible for this value.
if(document.ga_exp_key.length > 0){
function utmx_section(){}function utmx(){}(function(){var
k=document.ga_exp_key,d=document,l=d.location,c=d.cookie;
if(l.search.indexOf('utm_expid='+k)>0)return;
function f(n){if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.
indexOf(';',i);return escape(c.substring(i+n.length+1,j<0?c.
length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;d.write(
View 99-sites-enabled.conf
# File in: /etc/lighttpd/conf-available/99-sites-enabled.conf
include_shell "/usr/local/share/lighttpd/include-sites-enabled.pl"
View marketo-ate-my-work.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta class="mktoString" mktoName="Variable 1" id="var1" default="This is a variable">
<title></title>
<style>
body {background:#fff;}
</style>
</head>
View marketo-hates-raiased-mc.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta class="mktoString" mktoName="Variable 1" id="var1" default="This is a variable">
<title></title>
<style>
body {background:#fff;}
</style>
</head>
@starlocke
starlocke / add_all_github_forks.js
Last active Oct 30, 2017
Print out all "git remote add" commands for all the forks of a project.
View add_all_github_forks.js
// Execute this function upon a project's "/network/members" page.
// - You also need to "inject" jQuery onto that page, first.
// Ex: https://github.com/example/test/network/members (replace "example/test" - NO LONGER WORKS)
// Ex: https://github.com/google/git-appraise-web/network/members (another example)
function add_all_github_forks(){
var matches = window.location.href.match(/github.com[/]\w+[/]([^/]+)/); // [^/]+ used to be \w+, now also captures "-" in names
var project_name = '';
if(matches == null){
console.log("no match, quitting early");
return;
@starlocke
starlocke / IEUserAgentTest.html
Last active Aug 29, 2015 — forked from jasongaylord/IEUserAgentTest.html
A sample JavaScript file to detect IE compatibility mode and version. This is not recommended unless absolutely needed as features should be detected instead.
View IEUserAgentTest.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing IE Compatibility Mode</title>
<script src="ieUserAgent.js" type="text/javascript"></script>
</head>
<body>
<div id="results">Results:</div>
<script type="text/javascript">
var val = "IE" + ieUserAgent.version;