This file contains 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
/* to use WebSQL or the SQLite plugin (https://github.com/davibe/Phonegap-SQLitePlugin) with the same function) */ | |
executeSqlBridge: function(tx, sql, params, dataHandler, errorHandler) { | |
var self = this; | |
if (typeof self.db.dbPath !== 'undefined') { | |
//Native SQLite DB with phonegap : https://github.com/davibe/Phonegap-SQLitePlugin/ | |
//this is a native DB, the method signature is different: | |
var sqlAndParams = [sql].concat(params); | |
var cb = function(res) { |
This file contains 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
$ rails c | |
Running via Spring preloader in process 7916 | |
/Users/edmac/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require': dlopen(/Users/edmac/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin14/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError) | |
Referenced from: /Users/edmac/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin14/readline.bundle | |
Reason: image not found - /Users/edmac/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin14/readline.bundle | |
Fixed with: | |
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib |
This file contains 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
server { | |
listen 80; | |
server_name nagios.example.tld; | |
access_log /var/log/nginx/nagios.access.log; | |
error_log /var/log/nginx/nagios.error.log info; | |
expires 31d; | |
root /usr/share/nagios3/htdocs; |
This file contains 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
module InterruptibleSleep | |
def interruptible_sleep(seconds) | |
@_sleep_check, @_sleep_interrupt = IO.pipe | |
IO.select([@_sleep_check], nil, nil, seconds) | |
end | |
def interrupt_sleep | |
@_sleep_interrupt.close if @_sleep_interrupt | |
end | |
end |
This file contains 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
#!/bin/sh | |
PLUGINS_DIR="$HOME/Library/Application Support/Developer/Shared/Xcode/Plug-ins" | |
XCODE_INFO_PATH=$(xcode-select -p) | |
XCODE_INFO_PATH=$(dirname "$XCODE_INFO_PATH")/Info | |
DVTPlugInCompatibilityUUID=$(defaults read "$XCODE_INFO_PATH" DVTPlugInCompatibilityUUID) | |
for plugin in "$PLUGINS_DIR"/*.xcplugin; do | |
plugin_info_path="$plugin/Contents/Info" | |
if [[ -f "$plugin_info_path.plist" ]]; then |
This file contains 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 'pg' | |
require 'stringio' | |
$stderr.puts "Opening database connection ..." | |
conn = PGconn.connect( :dbname => 'test' ) | |
conn.exec( <<END_SQL ) | |
DROP TABLE IF EXISTS logs; |
This file contains 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:GetBucketLocation", | |
"s3:ListAllMyBuckets" | |
], | |
"Resource": "arn:aws:s3:::*" |
This file contains 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
# Phoenix Framework - A productive web framework that does not compromise speed and maintainability | |
[Unit] | |
Description=Phoenix Framework ISControl Application | |
After=network.target | |
[Service] | |
Type=simple | |
User=deployer | |
RemainAfterExit=yes |
This file contains 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
key = Eth::Key.new(priv: YOUR_PRIVATE_KEY) | |
client = Ethereum::HttpClient.new(...) | |
client.default_account = key.address | |
contract = Ethereum::Contract.create(...) | |
contract.key = key |
This file contains 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 'rubygems' | |
require 'bundler' | |
require 'fileutils' | |
require 'net/http' | |
require 'net/https' | |
require 'uri' | |
TMP_DIR = "/tmp/gems" |