Skip to content

Instantly share code, notes, and snippets.

View iamsebastian's full-sized avatar

Sebastian Blei iamsebastian

View GitHub Profile
@iamsebastian
iamsebastian / gist:dc869429e78ef22a8bfd67b3eda22178
Created March 25, 2019 16:33
Try to speedup Dell Boomi mapping
var i = function(f1, f2) { $('body > div:nth-child(21) > div:nth-child(2) > div > div:nth-child(5) > div > div > div:nth-child(4) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(4) > div > div:nth-child(2) > div > div.component_editor_panel > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(8) > div > div:nth-child(2) > div > div:nth-child(3) > div > div.text_search_box > input').value = f1; $('body > div:nth-child(21) > div:nth-child(2) > div > div:nth-child(5) > div > div > div:nth-child(4) > div > div:nth-child(3) > div > div:nth-child(3) > div > div:nth-child(4) > div > div:nth-child(2) > div > div.component_editor_panel > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(8) > div > div:nth-child(4) > div > div:nth-child(3) > div > div.text_search_box > input').value = f2; };
var j = function(arg) { var spl = arg.split('\t'); i.call(spl); console.log(spl); i.apply(this, spl);}
j('src_field dest_field');
@iamsebastian
iamsebastian / nginx.conf
Created December 13, 2018 12:13
[nginx] proxy pass with PATCH instead of PUT
# This is your nginx.conf to setting up a proxy, changing the
# HTTP method from * to PATCH, and forward the request.
http {
server {
listen 80;
location / {
proxy_method PATCH;
proxy_pass http://YOUR_URL:YOUR_PORT/;
}
❯ RUST_BACKTRACE=full cargo run --bin main
Compiling ...
error[E0412]: cannot find type `table` in module `age_within_the_range_gs`
--> src/models/age_within_the_range_gs.rs:18:10
|
18 | #[derive(AsChangeset, Clone, Debug, Insertable, RustcDecodable, RustcEncodable)]
| ^^^^^^^^^^^ did you mean `Table`?
|
help: possible candidates are found in other modules, you can import them into scope
|
@iamsebastian
iamsebastian / x.rs
Created July 5, 2017 08:34
group_by, api, rust
#[derive(Debug, RustcEncodable)]
struct ByRoughSegm {
count: i32,
id: i32,
kut_id: i32,
oe_id: i32,
sector_id: i32,
segment_id: i32,
}
let vec = X::find_all_based_on_y(y);
fn1(&Some(vec));
fn2(&Some(vec));
fn3(&Some(vec));
@iamsebastian
iamsebastian / gen.rs
Created October 27, 2016 11:01
Generate rust struct with documentation
macro_rules! generate_import_struct {
($doc:expr, name: $name:ident, $($element: ident: $ty: ty : $elem_doc: expr),*) => {
#[doc=$doc]
pub struct $name {
pub id: i32,
$(#[doc=$elem_doc]
pub $element: $ty),*
}
}
}
body { background: #f66; }
.throttled, .again {
background: linear-gradient(45deg, #f66, yellow);
height: 100px;
width: 400px;
animation: 1s skew infinite;
}
.again {
@iamsebastian
iamsebastian / dabblet.css
Created September 17, 2013 11:40
Untitled
html { background: #f06;
background: linear-gradient(45deg, #ff6, #6ff);
min-height: 100%; }
div {
width: 280px;
height: 100px;
vertical-align: middle;
background: #fff;
}
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@import url(http://fonts.googleapis.com/css?family=Roboto:400,900);
body {
background: #f06;
background: linear-gradient(0deg, #ddd, #ddd);
min-height: 100%;
font-family: 'Roboto', sans-serif;
margin: 0;
color: hsla(0,0%,100%,.9);
}