Skip to content

Instantly share code, notes, and snippets.

View kosso's full-sized avatar

Kosso kosso

View GitHub Profile

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
@hansemannn
hansemannn / av-merge.js
Last active June 9, 2019 16:37
Merge Audio- and Video-tracks in iOS using Titanium and Hyperloop
import {
AVMutableComposition,
AVURLAsset,
AVAsset,
AVMutableCompositionTrack,
AVAssetExportSession,
AVFoundation
} from 'AVFoundation';
import { NSArray, NSURL, Foundation } from 'Foundation';
@philmerrell
philmerrell / audio.service.ts
Created November 20, 2017 21:10
Angular audio service class
import { Injectable } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs/Rx';
@Injectable()
export class AudioService {
public audio: HTMLAudioElement;
public timeElapsed: BehaviorSubject<string> = new BehaviorSubject('00:00');
public timeRemaining: BehaviorSubject<string> = new BehaviorSubject('-00:00');
public percentElapsed: BehaviorSubject<number> = new BehaviorSubject(0);
@mohamedsalehamin
mohamedsalehamin / API.php
Last active September 14, 2021 23:46
Wp-Polls Rest Api Gist
<?php
/**********************************************************************
*
* Poll
*
**********************************************************************/
function get_poll_template_by_me($poll_id, $display_loading = true)
{
global $wpdb;
$data = array();
// http://www.2ality.com/2013/09/javascript-unicode.html
function toUTF16(codePoint) {
var TEN_BITS = parseInt('1111111111', 2);
function u(codeUnit) {
return '\\u'+codeUnit.toString(16).toUpperCase();
}
if (codePoint <= 0xFFFF) {
return u(codePoint);
}
@MakerAsia
MakerAsia / ESP32_wifi_dns.c
Last active January 9, 2023 07:15
ESP32 (ESP-IDF) WiFi connect and resolve DNS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "lwip/inet.h"
#include "lwip/ip4_addr.h"
#include "lwip/dns.h"
@devfred
devfred / audio-api-wrapper.ts
Last active February 17, 2020 19:17
Typescript: HTML5 Audio Wrapper for angular2
/**
* @class
* @description
* Wrapper for HTML5 audio.
*/
import {Injectable, NgZone} from 'angular2/core';
import {Observer} from 'rxjs/Observer';
import {Observable} from 'rxjs/Observable';
declare var AudioContext:any;
@revolunet
revolunet / web-audio-fetch-stream.js
Last active April 29, 2024 11:30
Web Audio streaming with fetch API
//
// loads remote file using fetch() streams and "pipe" it to webaudio API
// remote file must have CORS enabled if on another domain
//
// mostly from http://stackoverflow.com/questions/20475982/choppy-inaudible-playback-with-chunked-audio-through-web-audio-api
//
function play(url) {
var context = new (window.AudioContext || window.webkitAudioContext)();
@hotpaw2
hotpaw2 / RecordAudio.swift
Last active April 3, 2024 03:10
Swift Audio Recording class. Reads buffers of input samples from the microphone using the iOS RemoteIO Audio Unit API
//
// RecordAudio.swift
//
// This is a Swift class (updated for Swift 5)
// that uses the iOS RemoteIO Audio Unit
// to record audio input samples,
// (should be instantiated as a singleton object.)
//
// Created by Ronald Nicholson on 10/21/16.
// Copyright © 2017,2019 HotPaw Productions. All rights reserved.
@grantges
grantges / README.md
Created April 18, 2016 13:58
Titanium TSS for Transparent NavigationBar / Shadow on iOS

Creating a transparent NavigationBar using Titanium Style Sheets

Appcelerator Titanium offers many ways to style the navigation bar for iOS apps, from changing out the title view all together, or just using simple colors. However, one of the most frequent requests I hear is how to make a truly transparent NavigationBar. This tutorial will cover that.

Getting started

Lets start with a pretty simple window style in the app.tss. This will ensure that the window style is applied globally.

Note: This can be used in a specific controller *.tss file if you only want this effect on a particular window.