response = RestClient.post "http://api.sendcloud.net/apiv2/mail/send", :attachments => File.new('all.sql','rb'),:apiUser => 'metalist',:apiKey => 'key',:from => "[email protected]",:fromName => "noname",:to => "[email protected]",:subject => "users assets",:html => 'users assets: attachments'
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
Mix.install([ | |
{:nx, "~> 0.1.0"}, | |
]) | |
input = """ | |
13 26 9 44 | |
2 14 6 23 | |
14 20 3 28 | |
23 25 9 60 | |
13 24 8 42 | |
1 12 2 5 |
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
# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh | |
# Aliases | |
alias g='git' | |
#compdef g=git | |
alias gst='git status' | |
#compdef _git gst=git-status | |
alias gd='git diff' | |
#compdef _git gd=git-diff | |
alias gdc='git diff --cached' |
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
CREATE TABLE `a` ( | |
`id` INT(100) UNSIGNED NOT NULL AUTO_INCREMENT, | |
`userid` VARCHAR(11) DEFAULT NULL, | |
`subject` VARCHAR(11) DEFAULT NULL, | |
`score` INT(11) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=INNODB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; | |
INSERT INTO `a` (`id`, `userid`, `subject`, `score`) | |
VALUES |
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
const fs = require('fs'); | |
function check_result() { | |
return fs.existsSync('foo.txt'); | |
} | |
function* infiniteSequence() { | |
let num = 1 | |
while (true) { | |
yield num |
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
require './mysql-connector-java-5.1.47-bin.jar' | |
require "rubygems" | |
require "java" | |
require "csv" | |
begin | |
# Prep the connection | |
Java::com.mysql.jdbc.Driver | |
userurl = "jdbc:mysql://10.52.3.224:3306/market" |
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 'cocoa' | |
Cocoa::NSAutoreleasePool.new | |
app = Cocoa::NSApplication.sharedApplication | |
app.setActivationPolicy Cocoa::NSApplicationActivationPolicyRegular | |
app.activateIgnoringOtherApps true |
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(server1). | |
-export([start/2, rpc/2]). | |
start(Name, Mod) -> | |
register(Name, spawn(fun() -> loop(Name, Mod, Mod:init()) end)). | |
rpc(Name, Request) -> | |
io:format(" self at rpc is ~p~n", [self()]), | |
io:format(" Name at rpc is ~p~n", [Name]), | |
Name ! { self(), Request }, |
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
require 'bigdecimal' | |
def getRandomMoney(remainSize, remainMoney) | |
if remainSize == 1 | |
remainSize -= 1 | |
return remainMoney.floor(2) | |
end | |
min = 0.01 | |
max = remainMoney / remainSize * 2.0 |
NewerOlder