Skip to content

Instantly share code, notes, and snippets.

Avatar

iMil iMilnb

View GitHub Profile
@peterhellberg
peterhellberg / ffserver.conf
Last active Aug 1, 2020
MJPEG stream from Webcam using FFServer and FFMpeg
View ffserver.conf
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 200
MaxClients 100
MaxBandWidth 500000
CustomLog -
<Feed camera.ffm>
File /tmp/camera.ffm
FileMaxSize 200M
@flaviocopes
flaviocopes / check-substring-starts-with.go
Last active Sep 12, 2020
Go: check if a string starts with a substring #golang
View check-substring-starts-with.go
package main
import (
"strings"
)
func main() {
strings.HasPrefix("foobar", "foo") // true
}
@bowmanmike
bowmanmike / dynamic_function_calls.go
Created Feb 22, 2017
Golang Dynamic Function Calling
View dynamic_function_calls.go
package main
import (
"fmt"
)
// Use map[string]interface{} to pair functions to name
// Could maybe use anonymous functions instead. Might be clean
// in certain cases
var funcMap = map[string]interface{}{
@justinsoliz
justinsoliz / resources.tf
Created Aug 30, 2016
Terraform S3 to Lambda notification
View resources.tf
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_iam_role" "iam_for_terraform_lambda" {
name = "app_${var.app_env}_lambda"
assume_role_policy = <<EOF
{
@subfuzion
subfuzion / curl.md
Last active Sep 24, 2020
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

View Installer Debian sur un NAS Netgear.md
@shahril96
shahril96 / conkyrc
Created Nov 28, 2014
My simple conkyrc file. :)
View conkyrc
#========================================================================
# Conky-Serdar
#----------------------------------------------------------------------
#sudo apt-get install conky
#extract the zip file and move files to .conky in your home folder
#----------------------------------------------------------------------
#Run(Terminal):
# conky -c ~/.conky/conkyrc
#----------------------------------------------------------------------
#Autostart(Openbox):
@nyg
nyg / kraken-ledger.js
Created May 30, 2014
Get all entries of your Kraken.com ledger.
View kraken-ledger.js
/* Querying your ledger through Kraken's API only return 50 results... */
var KrakenClient = require('kraken-api'); // https://github.com/nothingisdead/npm-kraken-api
var kraken = new KrakenClient('api_key', 'api_secret');
var ledger = [];
var offset = 0;
function getLedgerEntries (error, data) {
@angstwad
angstwad / test_split_jinja_ansible.yml
Created Mar 31, 2014
Splitting in Jinja2/Ansible
View test_split_jinja_ansible.yml
---
- name: Test split
hosts: localhost
gather_facts: false
vars:
- facter_blockdevices: "sda,sdb,sdc,sdd,sde,sdf"
tasks:
- name: Let's split
debug: var=item
with_items: "facter_blockdevices.split(',')"
@xbot
xbot / gtkrc-2.0.mine
Last active Jun 22, 2017
gtkrc-2.0.mine for vim fixes
View gtkrc-2.0.mine
# fix for gvim border
style "vim-fix" {
bg[NORMAL] = "#002B36" # this matches my gvim theme 'Normal' bg color.
fg[NORMAL] = "#ffffff"
}
style "vim-fix-tabs" {
bg[NORMAL] = shade(1.02, "#656565")
bg[ACTIVE] = shade(1.25, "#878787")
fg[ACTIVE] = "#323232"
You can’t perform that action at this time.