Skip to content

Instantly share code, notes, and snippets.

View jamesmoriarty's full-sized avatar
🔮
0xc0000005

James Moriarty jamesmoriarty

🔮
0xc0000005
View GitHub Profile
@alexellis
alexellis / timelapse.md
Created March 9, 2017 08:48 — forked from porjo/timelapse.md
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

@azaharakis
azaharakis / results.html
Last active July 2, 2017 23:12
Results without hydration data
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
<link rel="stylesheet" href="/public/styles.css">
</head>
<body>
<div id="wrapper">
<div data-reactroot="" data-reactid="1" data-react-checksum="1210232727"><!-- react-empty: 2 -->
<div data-reactid="3"><a href="/" data-reactid="4"> Back to Home page </a>
@azaharakis
azaharakis / App.jsx
Last active July 2, 2017 23:12
Application using React
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import ComponentTreeWithData from './somme-other-component/foo/bar';
class App extends component {
state = {
loading: true,
data: null
}
constructor(props) {
@dnunez24
dnunez24 / varnishlog-purge.sh
Created September 13, 2016 15:57
Varnish View Logged Purge Requests
varnishlog -g request -q 'ReqMethod eq "PURGE"'
@cupracer
cupracer / varnishlog-examples.sh
Last active February 27, 2024 11:11
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header
accept_filter off [bool] (default)
acceptor_sleep_decay 0.9 (default)
acceptor_sleep_incr 0.000 [seconds] (default)
acceptor_sleep_max 0.050 [seconds] (default)
auto_restart on [bool] (default)
backend_idle_timeout 60.000 [seconds] (default)
ban_dups on [bool] (default)
ban_lurker_age 60.000 [seconds] (default)
ban_lurker_batch 1000 (default)
ban_lurker_sleep 0.010 [seconds] (default)
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
@jamesmoriarty
jamesmoriarty / query.rb
Last active April 29, 2016 19:30
Newrelic Insights Query
require 'net/http'
require 'uri'
require 'json'
module NewRelic
module Insights
class Query
attr_reader :key, :account_id
def initialize(key, account_id)
anonymous
anonymous / TokenValidator.cs
Created September 21, 2015 16:16
Validate JSON Web Token (JWT) With .NET JWT Library
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IdentityModel.Tokens;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using System.Text;
@v0lkan
v0lkan / nginx.conf
Last active April 2, 2024 18:25
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx