Skip to content

Instantly share code, notes, and snippets.

View derofim's full-sized avatar

Den derofim

  • Google
  • USA
View GitHub Profile
@derofim
derofim / main.cpp
Created March 10, 2019 19:37
cairo sdl2 opengl es 2
#include "WebView.h"
#include "IntSize.h"
#include <emscripten.h>
#ifdef DEBUG
#include "Logging.h"
#include <wtf/text/WTFString.h>
#endif
#include "cairo.h"
@derofim
derofim / crsl.cpp
Created March 10, 2019 09:08 — forked from andrew-pa/crsl.cpp
Cairo, GL, SDL together
#include <iostream>
#include <cairo/cairo.h>
#include <cairo/cairo-gl.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>
int main(int argc, char* argv[]) {
SDL_Init(SDL_INIT_VIDEO);
auto win = SDL_CreateWindow("crsl", 300, 300, 512, 512, SDL_WINDOW_OPENGL);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
@derofim
derofim / db-tips.md
Created March 3, 2019 09:15 — forked from bric3/UTF-8-demo.txt
Shell (commands) tips accumulated over years

DB

SQL

Create table using with

with user_count as (
 select
@derofim
derofim / emacs.md
Created March 3, 2019 09:14 — forked from adimanea/emacs.md
My emacs tips, tricks & config
@derofim
derofim / main.cpp
Created February 12, 2019 22:03
boost.beast sync. http & proxy example
/*
* Copyright (c) 2018 Denis Trofimov (den.a.trofimov@yandex.ru)
* Distributed under the MIT License.
* See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT
*/
// TODO: example_http_relay
// https://www.boost.org/doc/libs/master/libs/beast/example/doc/http_examples.hpp An HTTP proxy acts
// as a relay between client and server.
@derofim
derofim / create_example_certs.sh
Created February 12, 2019 03:13
create_example_certs.sh
#!/bin/bash
# Copyright (c) 2018 Denis Trofimov (den.a.trofimov@yandex.ru)
# Distributed under the MIT License.
# See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT
set -ev
# Used to create certs for localhost
# Don`t forget to add it to Chromium browser
@derofim
derofim / index.js
Created October 11, 2018 14:03
AWS node
const AWS = require('aws-sdk');
const { AWS: awsConfig } = require('../../config');
AWS.config.update({
accessKeyId: awsConfig.accessKeyId,
secretAccessKey: awsConfig.secretAccessKey,
region: awsConfig.region
});
@derofim
derofim / ffmpeg
Created September 12, 2018 20:21
ffmpeg mp4 to webm/ogv
ffmpeg -i local-video.mp4 -c:v libvpx -b:v 1M -c:a libvorbis output.webm
ffmpeg -i local-video.mp4 -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 output.ogv
https://superuser.com/questions/1096841/how-do-i-convert-mp4-to-ogv-while-still-retaining-the-same-quality-using-ffmpeg
https://askubuntu.com/questions/351593/bulk-batch-convert-mp4-and-m4v-files-to-webm-via-command-line

Keybase proof

I hereby claim:

  • I am derofim on github.
  • I am dentrof (https://keybase.io/dentrof) on keybase.
  • I have a public key ASAr7krvUpMUgebEWuoTz-PA16kr3PZA4gTZXxXo_f_K8wo

To claim this, I am signing this object:

@derofim
derofim / downloadFiles.sh
Last active February 3, 2018 14:25
play all videos
urls=(
"YOUR URL 1"
"YOUR URL 2"
)
for (( i = 0; i < ${#urls[@]}; ++i )); do
# create filename based on url.
filename=`echo ${i}.mp4`
echo "downloading ${urls[i]} to $filename"
curl -s -o "$filename" "${urls[i]}"