Skip to content

Instantly share code, notes, and snippets.

View amir20's full-sized avatar
🌴
On vacation

Amir Raminfar amir20

🌴
On vacation
View GitHub Profile
@frostming
frostming / api.js
Last active March 22, 2023 14:18
Flask WTF cookie based CSRF
// npm i js-cookie --save
import axios from 'axios'
import Cookies from 'js-cookie'
const api = axios.create({
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': Cookies.get('csrf_token')
})
@tseho
tseho / config.yml
Last active April 5, 2022 20:38
circleci + docker-compose + layers cache
version: 2
jobs:
build:
docker:
- image: docker:17.06.0-ce-git
steps:
- checkout
- setup_remote_docker
- run:
name: Install Docker Compose
@schickling
schickling / _README.md
Last active January 4, 2024 09:37
Script to import and export docker-machine configurations to sync between hosts/collaborators

docker-machine import/export

Script to import and export docker-machine configurations to sync between hosts/collaborators

Export (on host A)

$ docker-machine ls
NAME       ACTIVE   DRIVER         STATE     URL                            SWARM   DOCKER    ERRORS
dev        -        digitalocean   Running   tcp://example.com:2376                 v1.10.1
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@jeffkole
jeffkole / gist:4047435
Created November 9, 2012 18:41
Avro IO with different reader and writer schemas
WRITER_SCHEMA = <<-JSON
{ "type": "record",
"name": "User",
"fields" : [
{"name": "username", "type": "string"},
{"name": "age", "type": "int"},
{"name": "verified", "type": "boolean", "default": "false"}
]}
JSON
@jcsalterego
jcsalterego / jstatd.all.policy
Created August 7, 2012 13:14
Run Remote Jstatd
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
@amir20
amir20 / package.json
Created February 28, 2012 21:34
A rails proxy written in node.js for testing assets. No need for apache.
{
"name": "rails-proxy",
"version": "0.0.1",
"dependencies": {
"http-proxy": "*",
"node-static": "*"
},
"engines": { "node": ">= 0.4.4" }
}
@docwhat
docwhat / rails31init.md
Created September 3, 2011 03:01 — forked from niquola/rails31init.md
Rails 3.1 with Rspec, Factory Girl, Haml, Database Cleaner, Spork, and Guard

Install Rails 3.1

gem install rails

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile