Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View caniszczyk's full-sized avatar
💭
always paying it forward

Chris Aniszczyk caniszczyk

💭
always paying it forward
View GitHub Profile
@caniszczyk
caniszczyk / gist:4150193
Created November 26, 2012 19:45
count "fuck" or "oops" in github commit messages
SELECT repository_name, repository_language, repository_description, repository_watchers, payload_commit_msg, url, PARSE_UTC_USEC(created_at) as timestamp
FROM [githubarchive:github.timeline]
WHERE type="PushEvent"
AND (
LOWER(payload_commit_msg) CONTAINS "fuck" OR
LOWER(payload_commit_msg) CONTAINS "oops"
)
AND PARSE_UTC_USEC(created_at) >= PARSE_UTC_USEC('2011-02-01 00:00:00')
ORDER BY timestamp DESC
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>sonatype-nexus-staging</id>
<username>caniszczyk</username>
<password>password</password>
@caniszczyk
caniszczyk / github_profanity.sql
Created December 28, 2012 20:41
A query against the GitHub Archive for "seven dirty word" usage in 2012
SELECT repository_name, repository_language, repository_description, repository_watchers, payload_commit_msg, url, PARSE_UTC_USEC(created_at) as timestamp
FROM [githubarchive:github.timeline]
WHERE type="PushEvent"
AND (
LOWER(payload_commit_msg) CONTAINS "shit" OR
LOWER(payload_commit_msg) CONTAINS "piss" OR
LOWER(payload_commit_msg) CONTAINS "fuck" OR
LOWER(payload_commit_msg) CONTAINS "cunt" OR
LOWER(payload_commit_msg) CONTAINS "cocksucker" OR
LOWER(payload_commit_msg) CONTAINS "motherfucker" OR
@caniszczyk
caniszczyk / list.sql
Created January 18, 2013 15:22
List all pull requests for the Eclipse organization via the GitHub Archive
SELECT repository_name, repository_language, repository_description, url, payload_pull_request_head_repo_size, PARSE_UTC_USEC(created_at) as timestamp
FROM [githubarchive:github.timeline]
WHERE type="PullRequestEvent"
AND (
LOWER(repository_organization) CONTAINS "eclipse"
)
AND PARSE_UTC_USEC(created_at) >= PARSE_UTC_USEC('2012-01-01 00:00:00')
ORDER BY timestamp DESC;
@caniszczyk
caniszczyk / mesos-stats.rb
Created August 21, 2013 19:37
Gets some basic statistics about Apache Mesos using the GitHub API
#!/usr/bin/env ruby
require 'octokit'
require 'csv'
client = Octokit::Client.new(auto_traversal: true, per_page: 500);
puts client.ratelimit_remaining
CSV.open("stats.csv", "wb") do |csv|
repo = client.repo("apache/mesos")
stats = client.commit_activity_stats("apache/mesos")
total_commits_per_year = 0
/etc
/usr/lib
/usr/bin
char
scala
java
cache
solaris
linux (strong no hire if gnu is mentioned)
plan9
@caniszczyk
caniszczyk / gist:8135894
Last active January 1, 2016 11:09
List of organizations (top 100) who open sourced the most private repos on GitHub in 2013 (as of Dec 26th)
quickly gathered using the Github Archive data, thanks @igrigorik
http://www.githubarchive.org/
SELECT repository_organization, count(repository_organization) as opens
FROM [githubarchive:github.timeline]
WHERE type="PublicEvent"
AND PARSE_UTC_USEC(created_at) >= PARSE_UTC_USEC("2013-01-01 00:00:00")
GROUP BY repository_organization
ORDER BY opens DESC
LIMIT 100
@caniszczyk
caniszczyk / gist:8177690
Last active January 1, 2016 17:29
Response to "An Engineer's Guide to US Visas"
  • TN visas: applies to also Mexicans
  • TNs depend heavily on your degree as they are mapped to TN: (a) there is a category for engineers if you have a formal degree in CS/ECE (b) if you don't have that degree but are an "engineer" (e.g., picked it up on your spare time) you can go through the "Management Consultant" route but to note that is the hardest TN to usually get and will pretty much depend how the visa officers treat you

I would definitely mention the Management Consultant route as there are a lot of people who may not be formally schooled in engineering but have picked it up. 5 years of "equivalent work experience" also can help you obtain this visa category

There is also hidden risks about potentially changing jobs with H1B / TN visas. ONLY SWITCH jobs if you are fully approved for the transfer and new visa. I've had friends that took the new job assuming the visa transfer would go through and were left having to vacate the country. This is the most thing I hate about immigration visas, it's real

@caniszczyk
caniszczyk / gist:8292751
Created January 7, 2014 00:47
sample-sonatype-settings
[tw-mba13-caniszczyk luna (master)]$ cat ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>caniszczyk</username>
<password>YOUR_PASSWORD</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
@caniszczyk
caniszczyk / gist:8920758
Last active August 29, 2015 13:56
Connect to remote host Finagle / Netty
private[netty3] class ChannelConnector[In, Out](
newChannel: () => Channel,
newTransport: Channel => Transport[In, Out]
) extends (SocketAddress => Future[Transport[In, Out]]) {
def apply(addr: SocketAddress): Future[Transport[In, Out]] = {
require(addr != null)
val ch = try newChannel() catch {
case NonFatal(exc) => return Future.exception(exc) #1
}
// Transport is now bound to the channel; this is done prior to