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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// Generated by gfwlist2pac in precise mode | |
// https://github.com/clowwindy/gfwlist2pac | |
var proxy = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT;"; | |
var rules = [ | |
"||altrec.com", | |
"||darpa.mil", | |
"||fastpic.ru", | |
"||fxnetworks.com", |
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
+-----------+----------------------------+----------+ | |
| col_name | data_type | comment | | |
+-----------+----------------------------+----------+ | |
| cust_id | string | | | |
| part_num | int | | | |
| ip_list | array<struct<ip:string>> | | | |
| vid_list | array<struct<vid:string>> | | | |
| fso_list | array<struct<fso:string>> | | | |
| src | string | | | |
| date | int | | |
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
def createParquetTable(name: String, file: String)(implicit sqlc: HiveContext): Unit = { | |
import org.apache.spark.sql.hive.HiveMetastoreTypes | |
import sqlc._ | |
val rdd = parquetFile(file) | |
val schema = rdd.schema.fields.map(f => s"`${f.name}` ${HiveMetastoreTypes.toMetastoreType(f.dataType)}").mkString(",\n") | |
val cleanup = s""" | |
|DROP TABLE IF EXISTS $name | |
""".stripMargin |
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
# This is example code for influencer notification using FullContact on node.js | |
# Programming language used here is iced-coffee-script | |
# Author: Maptia | |
# License: public domain | |
_ = require 'underscore' | |
iced = require('iced-coffee-script').iced | |
request = require 'request' | |
fullContactAPIKey = '<your-fullcontact-api-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
(defmacro query-preparing (query &rest args/format) | |
"Like query, but make the query prepared (only once)." | |
(let* ((format :rows) | |
(args (loop for arg in args/format | |
if (or (postmodern::dao-spec-for-format arg) | |
(assoc arg postmodern::*result-styles*)) | |
do (setf format arg) | |
else | |
collect arg))) | |
`(funcall |
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
.............................................................................................................................................................................................................................................................. | |
Reanalysing database... | |
NOTICE: no notnull values, invalid stats | |
NOTICE: no notnull values, invalid stats | |
ANALYZE | |
ERROR: please download osmosis | |
please download osmosis |
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
var port = process.env.HTTP_PORT || 3000 | |
, securePort = process.env.HTTPS_PORT || 3443 | |
var httpsOptions = { | |
key: fs.readFileSync('./cert/private.key.insecure').toString() | |
, cert: fs.readFileSync('./cert/public.cert').toString() | |
}; | |
// Start web server | |
var server = http.createServer(ss.http.middleware) |
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
CL-USER> (defvar *a* 1) | |
*A* | |
CL-USER> (let ((*a* 2)) (sb-thread:make-thread (lambda () (print *a*)))) | |
1 | |
#<SB-THREAD:THREAD FINISHED values: 1 {100482B0C1}> | |
CL-USER> (let ((*a* 2)) (when (zerop (sb-posix:fork)) (with-open-file (f "/tmp/a-value" :direction :output) (print *a* f)))) | |
NIL | |
$ cat /tmp/a-value |