This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "cmd+enter", | |
"command": "renameFile", | |
"when": "explorerViewletVisible && filesExplorerFocus" | |
}, | |
{ | |
"key": "enter", | |
"command": "-renameFile", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "cmd+enter", | |
"command": "renameFile", | |
"when": "explorerViewletVisible && filesExplorerFocus" | |
}, | |
{ | |
"key": "enter", | |
"command": "-renameFile", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
type Value = i32; | |
struct SymbolTable { | |
// We wish to own the parent SymbolTable, but we need a level of indirection | |
// with box, otherwise it would create an unallocatable recursive structure. | |
parent: Option<Box<SymbolTable>>, | |
values: HashMap<String, Value>, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(dead_code)] | |
use std::path::PathBuf; | |
use std::env; | |
fn find_abs_lib_path(lib_name: &str) -> Result<PathBuf, &str> { | |
let mut search_paths = vec![]; | |
if let Some(ld_library_path) = env::var_os("LD_LIBRARY_PATH") { | |
search_paths.extend(env::split_paths(&ld_library_path)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![cfg_attr(debug_assertions, allow(dead_code, unused_imports, unused_variables))] | |
use packed_simd; | |
use std::env; | |
use std::error; | |
use std::fs::File; | |
use std::io::Seek; | |
use std::io::SeekFrom; | |
use std::io; | |
use std::io::Write; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
Bundler.require | |
NoBrainer.configure do |config| | |
config.app_name = 'test' | |
config.environment = 'dev' | |
config.logger = Logger.new(STDERR).tap { |l| l.level = Logger::DEBUG } | |
end | |
NoBrainer.drop! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# `Gemfile` should have the following: | |
# source 'https://rubygems.org' | |
# gem 'goliath' | |
# gem 'nobrainer', :github => 'nviennot/nobrainer' | |
require 'bundler' | |
Bundler.require | |
# NoBrainer configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'fileutils' | |
#################### | |
# Global vars | |
#################### | |
$skip_upload=false | |
$skip_screenshot=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def synchronize | |
begin | |
lock | |
rescue Recovered | |
# don't care | |
end | |
begin | |
block.call | |
ensure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def controller_action | |
center = some_point | |
models = Model.where(:location.near => {:point => center :max_distance => 100}) | |
render :json => models.map { |m| :distance => SomeGeoGem.distance(m.location, center), :name => m.name } | |
end |
NewerOlder