Skip to content

Instantly share code, notes, and snippets.

@koenpunt
koenpunt / chosen-bootstrap.css
Last active March 11, 2023 01:01
Bootstrap 3.0 theme for Chosen
select.form-control + .chosen-container.chosen-container-single .chosen-single {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;
@DavertMik
DavertMik / gist:7969053
Created December 15, 2013 04:53
EmailTestCase for testing emails with MailCatcher in PHPUnit
<?php
class EmailTestCase extends PHPUnit_Framework_TestCase {
/**
* @var \Guzzle\Http\Client
*/
private $mailcatcher;
public function setUp()
{
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@alexwilson
alexwilson / cloudflare-challenge.js
Last active September 3, 2021 17:23
This is a project designed to get around sites using Cloudflare's "I'm under attack" mode. Using the PhantomJS headless browser, it queries a site given to it as the second parameter, waits six seconds and returns the cookies required to continue using this site. With this, it is possible to automate scrapers or spiders that would otherwise be t…
/**
* This is a project designed to get around sites using Cloudflare's "I'm under attack" mode.
* Using the PhantomJS headless browser, it queries a site given to it as the second parameter,
* waits six seconds and returns the cookies required to continue using this site. With this,
* it is possible to automate scrapers or spiders that would otherwise be thwarted by Cloudflare's
* anti-bot protection.
*
* To run this: phantomjs cloudflare-challenge.js http://www.example.org/
*
* Copyright © 2015 by Alex Wilson <antoligy@antoligy.com>
@mtrense
mtrense / Rakefile
Last active November 10, 2022 18:37
Dynamically create Rake tasks for all Dockerfiles (following the convention "<name>.Dockerfile") in the current directory
require 'rake/file_list'
IMAGES = Rake::FileList['*.Dockerfile'].collect {|f| f[/.+(?=\.Dockerfile)/] }
namespace :images do
IMAGES.each do |name|
desc "Build image '#{name}'"
task "build_#{name}" do
sh "docker build -f #{name}.Dockerfile -t mtrense/#{name} ."
end
@mattweldon
mattweldon / up-and-running-with-edeliver-on-do.md
Last active September 3, 2021 16:48
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new droplet
  • London
  • Ubuntu
  • No apps
  • Add SSH keys
@kylemcdonald
kylemcdonald / CameraImage.cpp
Created November 23, 2015 15:30
openFrameworks app for sending images to disk for processing, and reading text back from disk. Used for "NeuralTalk and Walk".
#include "ofMain.h"
#include "ofxTiming.h"
class ofApp : public ofBaseApp {
public:
ofVideoGrabber grabber;
DelayTimer delay;
ofTrueTypeFont font;
string description;
@tomysmile
tomysmile / mac-php-composer-setup.md
Created July 11, 2016 10:45
Setup PHP Composer using Brew
production: # Environment
first_thing: # Hook point
command: apt-get install freetds-bin freetds-dev nodejs -y
target: any # Hook fields
execute: true
sudo: true
@mankind
mankind / rails-jsonb-queries
Last active April 17, 2024 12:14
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")