Skip to content

Instantly share code, notes, and snippets.

View lc0's full-sized avatar

Sergii Khomenko lc0

View GitHub Profile
@handloomweaver
handloomweaver / oursql-install
Created August 1, 2011 10:02
Installing oursql via pip on Mac OS X
# switch to super user
sudo -i
# set up environment
export PIP_MYSQL_CONFIG=/usr/local/mysql/bin/mysql_config
export MYSQL_CONFIG=/usr/local/mysql/bin/mysql_config
# install
pip install oursql
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@johnynek
johnynek / reach2.scala
Created November 1, 2012 20:35
Second followers in scalding
ackage com.twitter.ads.batch.experimental.oscar
import com.twitter.scalding._
import com.twitter.pluck.job._
import com.twitter.pluck.source._
import com.twitter.pluck.source.matrix._
import com.twitter.pluck.mathematics._
import com.twitter.scalding.mathematics.Monoid
/*
@wch
wch / app.r
Last active July 30, 2024 21:07
Shiny example app with dynamic number of plots
max_plots <- 5
ui <- fluidPage(
headerPanel("Dynamic number of plots"),
sidebarPanel(
sliderInput("n", "Number of plots", value=1, min=1, max=5)
),
@igrigorik
igrigorik / drive-appscript.js
Last active September 13, 2024 07:27
Sample BigQuery queries for the HTTP Archive dataset.
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [ {name: "Run Query", functionName: "runQuery"} ];
ss.addMenu("HTTP Archive + BigQuery", menuEntries);
}
function runQuery() {
var projectNumber = 'httparchive';
var sheet = SpreadsheetApp.getActiveSheet();
@romainfrancois
romainfrancois / README.md
Last active December 26, 2015 16:19
getting github issues for a given repo

Simple R script that grabs the opened issues from a github repo :

$ github_issues hadley/dplyr
   number           user                                                         title                labels
1      98         hadley                                   Setup databases with travis           enhancement
2      97         hadley                                               Unique operator           enhancement
3      96         hadley                           Implement right join and outer join           enhancement
4      95 romainfrancois                                             Hybrid evaluation enhancement, internal
5      94         hadley                 Make sure all vignettes work from R CMD check                   bug
@gabrielemariotti
gabrielemariotti / AndroidManifest.xml
Last active April 4, 2023 11:15
Android Wear: Heart Rate and Samsung Gear Live. (basic example)
<!-- Declare the permission for body sensor -->
<uses-permission android:name="android.permission.BODY_SENSORS" />
@aiworld
aiworld / deep_drive_model.prototxt
Last active August 10, 2021 06:03
DeepDrive - Vision model that drives in GTAV
name: "GTANet"
# Can be used with pretrained Caffenet (AlexNet architecture).
# Layers with names containing 'gtanet' are not transferred from Caffenet.
layer {
name: "gta_frames_input_layer"
type: "HDF5Data"
top: "images"
top: "targets"