Skip to content

Instantly share code, notes, and snippets.

@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
@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>
production: # Environment
first_thing: # Hook point
command: apt-get install freetds-bin freetds-dev nodejs -y
target: any # Hook fields
execute: true
sudo: true
@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()
{
@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
@tomysmile
tomysmile / mac-php-composer-setup.md
Created July 11, 2016 10:45
Setup PHP Composer using Brew
@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;
@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.

@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;
import type { Product } from '@prisma/client';
import type { LoaderFunction } from '@remix-run/node';
import { Link, useLoaderData } from '@remix-run/react';
import { db } from '~/db/db.server';
interface LoaderData {
products: Product[];
count: number;
pageNumber: number;
}