Skip to content

Instantly share code, notes, and snippets.

View jasonsemko's full-sized avatar

Jason jasonsemko

  • Santa Monica, CA
View GitHub Profile
/**
* PowerReviews, Copyright 2019
* HEAD | d3227477c | 2/13/2019
*/
.p-w-r {
display: block!important
}
.p-w-r a,
function changeCase(identifier, targetCase){
if(identifier.length === 0) { return "" }
if(!targetCase.match(/^(snake|kebab|camel)$/)) { return undefined }
var replaceCapsWithStars = identifier.replace(/[A-Z]/g, '*')
if(new Set(replaceCapsWithStars.match(/[_\-\*]/g)).size > 1) { return undefined }
identifier = identifier.replace(/[A-Z]/g, (match) => '-' + match.toLowerCase())
identifierArray = identifier.split(/[_\-]/g)
@jasonsemko
jasonsemko / gist:6803968
Created October 3, 2013 02:47
Flying Birds
Claim: Not all birds can fly.
Assume all birds b can fly fly()
∀b(fly(b))
However, chickens cannot fly, so the statement is false as:
∃b(¬fly(b))
fatal: remote error: Repository does not exist
The requested repository does not exist, or you do not have permission to
access it.
@jasonsemko
jasonsemko / karger
Last active December 20, 2015 03:39
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
public class KragerMinCut {
public static int lineCount = 1;
public static int prevMinSize = 100;
public static void main(String[] args) throws IOException {
//The different between the two is the ^ and $...I'd assume the entire string is evaluated as one but this doesn't seem to be the case.
//Why does this alert true?...if there anything not a-z I expected a false
alert(/[A-z]*/gm.test("Hell7o"));
//This is what I expected from the above
alert(/^[A-z]*$/gm.test("Hell7o"));

Number 7 on confluence page

Configure the site instances

Edit /path/to/drupal/drushrc.php

... Edit /path/to/drupal/sites/default/aliases.drushrc.php

Follow configuration instructions for

@jasonsemko
jasonsemko / gist:5825681
Last active December 18, 2015 18:29
My answer
Get the two red balls and find out which one weighs more.
Take the lighter red and put the following
[ r1 g(1,2) ] ----- [ g(1,2) y(1,2)]
If:
* left weighs more then both on right, green/yellow are lighter
* both weigh same, then green left is heavy and yellow right is heavy
<span style="font-weight:bold;color:blue;">hello</span>
2014-06-18 01:31:29,620 DEBUG [ajp-las1.vmplappp31%2F10.53.69.20-8009-6] [DisclaimerFilteringResponseStreamFactory.java:103] Releasing connection...
2014-06-18 01:31:31,620 DEBUG [ajp-las1.vmplappp31%2F10.53.69.20-8009-14] [IpAddressExtractorImpl.java:47] inside ip address extractor. Header request 63.159.249.70
2014-06-18 01:31:31,621 DEBUG [ajp-las1.vmplappp31%2F10.53.69.20-8009-14] [IpAddressExtractorImpl.java:51] Parsed address : 63.159.249.70
2014-06-18 01:31:31,621 INFO [ajp-las1.vmplappp31%2F10.53.69.20-8009-14] [ResourceClientExecutor.java:108] Loading resource http://rp.lexus.com/quova/v1/ipinfo/63.159.249.70?format=json&apiKey=220.1.51dde329e4b02ff9865ce681.5itGmvr5n&sig=97e2346105606687b7de2f9513e07b54
2014-06-18 01:31:31,679 INFO [ajp-las1.vmplappp31%2F10.53.69.20-8009-14] [ResourceClientExecutor.java:124] Request to http://rp.lexus.com/quova/v1/ipinfo/63.159.249.70?format=json&apiKey=220.1.51dde329e4b02ff9865ce681.5itGmvr5n&sig=97e2346105606687b7de2f9513e07b54 completed in 57ms
2014-06-18 01:31:3