Skip to content

Instantly share code, notes, and snippets.

use crossbeam_deque::{Injector, Stealer, Worker};
use tokio::sync::Mutex;
use std::{iter, sync::Arc, time::Duration};
const NUMBER_OF_WORKERS: usize = 10;
pub struct Job {}
// this is taken straight of the crossbeam::deque docs
View init.lua
local cmd = vim.cmd -- to execute Vim commands e.g. cmd('pwd')
local fn = vim.fn -- to call Vim functions e.g. fn.bufnr()
local g = vim.g -- a table to access global variables
local opt = vim.opt -- to set options
cmd 'packadd paq-nvim' -- load the package manager
local paq = require('paq-nvim').paq -- a convenient alias
paq {'savq/paq-nvim', opt = true} -- paq-nvim manages itself
paq {'junegunn/fzf'}
paq {'junegunn/fzf.vim'} -- to enable preview (optional)
drogus / Dockerfile
Created December 2, 2018 23:06
AWS lambda rust
View Dockerfile
FROM amazonlinux:2017.03.1.20170812-with-sources
RUN curl -sSf | /bin/sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup install nightly
RUN yum install -y gcc gcc-c++ make openssl openssl-devel
RUN mkdir /code
drogus / components.xss-test.js
Last active September 29, 2017 08:27
View components.xss-test.js
import Ember from 'ember';
export default Ember.Component.extend({
name: Ember.computed(function() {
return `<h1 style="color: red">pwnd</h1>`;
xss: Ember.computed(function() {
return Ember.String.htmlSafe("<b>" + Ember.Handlebars.Utils.escapeExpression(this.get('name')) + "</b>");
drogus / controllers.application.js
Created February 20, 2017 10:35
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'

Requesting a build through the API can be done by sending a POST request to a /repo/{slug|id}/requests path.

Here is script for sending minimal request to a travis-ci/travis-core repository, for a master branch:

"request": {
#!/usr/bin/env python
import time
from pyo import *
s = Server(duplex=0).boot()
left = [
Sine( phase = 0.25, freq = 400, mul = 0.5 ),
View Setting longer HTTP timeout in capybara
Capybara.register_driver :selenium_with_long_timeout do |app|
client =
client.timeout = 120, :browser => :firefox, :http_client => client)
Capybara.javascript_driver = :selenium_with_long_timeout
drogus / post_form.rb
Last active August 29, 2015 14:03
form objects
View post_form.rb
class PostForm
include Virtus.model
extend ActiveModel::Naming
include ActiveModel::Validations
attribute :id, Integer
attribute :title, String
attribute :body, String
validates :title, presence: true
drogus / gist:10368834
Last active August 29, 2015 13:58 — forked from qoobaa/gist:10368474
View gist:10368834
this.resource("restaurant", { path: "/restaurants/:restaurant_id" }, function () {
this.resource("bookings", function () {
this.resource("booking", { path: "/bookings/:booking_id" });