Skip to content

Instantly share code, notes, and snippets.

View hellvesper's full-sized avatar

Vitaly hellvesper

View GitHub Profile
@Edudjr
Edudjr / Drink.swift
Created August 9, 2019 11:27
Codable/Decodable example for parsing JSON with optional parameters
class Drink: Codable {
var name: String
var color: String?
private enum CodingKeys: String, CodingKey {
case name, color
}
required init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
@hlorand
hlorand / vidstab_ffmpeg.md
Last active June 22, 2024 19:07
Video stabilization using VidStab and FFMPEG

Video stabilization using VidStab and FFMPEG

** Step 1 **

Install ffmpeg with the vidstab plugin.

@RabaDabaDoba
RabaDabaDoba / ANSI-color-codes.h
Last active July 20, 2024 00:58 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
@glegrain
glegrain / uart.c
Last active March 26, 2024 23:29
STM32 printf retarget to UART
/*# 1- Identify the UART interface, GPIO pins and Alternate Function #########*/
/* For example:
* B-L475E-IOT01A:
* PB6 ------> USART1_TX
* PB7 ------> USART1_RX
*
* NUCLEO-L476RG:
* PA2 ------> USART2_TX
* PA3 ------> USART2_RX
*
@WangYihang
WangYihang / socks-proxy-simple.py
Last active June 4, 2022 04:11
A simple socks server via python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 一个简单的 Socks5 代理服务器 , 只有 server 端 , 而且代码比较乱
# 不是很稳定 , 而且使用多线程并不是 select 模型
# Author : WangYihang <wangyihanger@gmail.com>
import socket
import threading
import sys
@hellvesper
hellvesper / ProxyCheck.php
Last active May 23, 2016 16:56 — forked from s4l1h/Socks5ProxyCheck.php
Socks5 Proxy Checker: php ve curl ile ip:port şeklindeki listeden çalışan sock5 proxy adreslerini bulur.
<?php
error_reporting(E_ALL);
ini_set('max_execution_time',0);
# http://www.vipsocks24.com/
$list="107.10.35.178:42427
108.20.152.202:1415
110.142.196.145:43134
115.118.195.23:1080
115.252.100.245:1080
115.252.143.165:1080
@freman
freman / blacklist.scpt
Created December 16, 2015 07:02
Spotify blacklist script.
repeat
if application "Spotify" is running then
tell application "Spotify"
set seenTrack to ""
repeat while player state is playing
if player state is playing then
set theAlbum to album of the current track
set theTrack to name of the current track
set theArtist to artist of the current track
set trackLength to duration of current track
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@jtdp
jtdp / gist:5443297
Last active July 16, 2024 14:40
See changes before pulling from remote git repository
# fetch the changes from the remote
git fetch origin
# show commit logs of changes
git log master..origin/master
# show diffs of changes
git diff master..origin/master
# apply the changes by merge..
@felipecsl
felipecsl / restart coreaudio daemon
Last active July 20, 2024 22:56
Restart Mac OS X coreaudio daemon. Useful if you cannot change the audio output device to Airplay.
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`
# or...
sudo killall coreaudiod