Skip to content

Instantly share code, notes, and snippets.

View cskonopka's full-sized avatar
📺
stuck inside a television

Christopher Konopka cskonopka

📺
stuck inside a television
  • vondas-network
  • Boston, MA
  • Instagram cskonopka
View GitHub Profile
@mathiasbynens
mathiasbynens / escape.js
Created June 26, 2019 07:29
Escaping JSON-stringified data for use as a JavaScript string literal
// This object contains a string value that in contains a single quote,
// a double quote, a backtick, and a backslash.
const data = { foo: `a'b"c\`d\\e` };
// Turn the data into its JSON-stringified form.
const json = JSON.stringify(data);
// Now, we want to insert the data into a script body as a JavaScript
// string literal per https://v8.dev/blog/cost-of-javascript-2019#json,
// escaping special characters like `"` in the data.
@peterhellberg
peterhellberg / ebiten-chart.go
Created October 11, 2018 19:41
go-chart rendered by Ebiten
package main
import (
"container/ring"
"image"
"log"
"math/rand"
"os"
"time"
@dave-malone
dave-malone / aws-iot-update-thing-shadow-lambda-function.js
Last active May 25, 2022 05:57
AWS Lambda function example of how to update IoT Thing Shadows
const AWS = require('aws-sdk')
AWS.config.region = process.env.AWS_REGION
const AWS_IOT_CORE_ENDPOINT = process.env.MQTT_BROKER_ENDPOINT
const IOT_THING_NAME = process.env.THING_NAME
const iotdata = new AWS.IotData({
endpoint: AWS_IOT_CORE_ENDPOINT,
})
@random-robbie
random-robbie / install_go_pi.sh
Created April 26, 2018 14:16
Install Go Lang 1.10.1 on Raspberry Pi 3
wget https://storage.googleapis.com/golang/go1.10.1.linux-armv6l.tar.gz
sudo tar -C /usr/local -xvf go1.10.1.linux-armv6l.tar.gz
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
LINUX
======
rajdeeprath@rajdeeprath-VirtualBox:~$ ffmpeg -i /home/rajdeeprath/Downloads/bbb_480p_1000_64_1.mp4 -vcodec libx264 -vb 500k -vprofile baseline -level 2.1 -acodec libfdk_aac -ab 64000 -ar 48000 -ac 2 -f flv "rtmp://127.0.0.1:1935/live?username=testuser&password=testpass/streamname"
WINDOWS
=======
C:\Users\rajde>ffmpeg -i K:\lpackage\bbb_480p_1000_64.mp4 -vcodec libx264 -vb 500k -vprofile baseline -level 2.1 -acodec aac -ab 64000 -ar 48000 -ac 2 -strict experimental -f flv "rtmp://127.0.0.1:1935/live/streamname app=live?username=testuser&password=testpass live=1"
@Piasy
Piasy / install_ffmpeg.sh
Last active April 14, 2024 05:40
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@bolerap
bolerap / alpine_proxy_setting.md
Created September 11, 2017 08:13
Setting proxy for alpine linux
  1. create a file to keep environment variables (called env.sh here) at /etc/profile.d/env.sh
  2. export two proxy variable in /etc/profile.d/evn.sh as below
export http_proxy=http://<ip/name>:<port>
export https_proxy=$http_proxy
@nikhita
nikhita / update-golang.md
Last active June 17, 2024 16:29
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@shashankmehta
shashankmehta / setup.md
Last active January 7, 2024 11:57
Setup PHP and Composer on OSX via Brew

First install Brew on your MAC

  • Setup Brew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • brew update
  • brew tap homebrew/dupes
  • brew tap homebrew/php
  • Install PHP 7.0.+ brew install php70
  • Install mcrypt: brew install mcrypt php70-mcrypt
  • Finally, install composer: brew install composer
@arxdsilva
arxdsilva / working_directory.go
Last active February 12, 2024 13:30
How to get the current working directory in golang
package main
// More info on Getwd()
// https://golang.org/src/os/getwd.go
//
import(
"os"
"fmt"
"log"
)