Skip to content

Instantly share code, notes, and snippets.

View keinajar's full-sized avatar

Jari Keinänen keinajar

View GitHub Profile
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
NSLayoutConstraint.activate([
tableView.topAnchor.constraint(equalTo: view.topAnchor),
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@maximveksler
maximveksler / FuckingAVFoundation.m
Created February 25, 2014 23:36
Fucking AV Foundation code with audio and video mixing
- (void)buildTransitionCompositionAUDIO:(AVMutableComposition *)composition andVideoComposition:(AVMutableVideoComposition *)videoComposition andAudioMix:(AVMutableAudioMix *)audioMix
{
CMTime nextClipStartTime = kCMTimeZero;
// Add two video tracks and two audio tracks.
AVMutableCompositionTrack *compositionVideoTracks[2];
AVMutableCompositionTrack *compositionAudioTracks[2];
compositionVideoTracks[0] = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];
compositionVideoTracks[1] = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];
@pxslip
pxslip / brew-sync.sh
Last active December 29, 2015 02:39 — forked from jpawlowski/brew-sync.sh
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
# Also syncs gui applications installed using brew-cask (https://github.com/phinze/homebrew-cask)
# Modified from https://gist.github.com/jpawlowski/5248465
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
$BREW tap > /tmp/brew-sync.taps
@diego898
diego898 / rd.md
Last active October 13, 2020 21:18
Enable Concurrent Remote Desktop Users in Windows 8.1 x64

thanks to @neurodyne and this link for updated instructions

This works with the following versions of termsrv.dll

x64 - termsrv.dll - 6.3.9600.17095

Find Replace
39813C0600000F849E310500 B80001000089813806000090
090085C07F078BD8 090085C090908BD8
@jpawlowski
jpawlowski / brew-sync.sh
Last active September 26, 2023 19:54
Sync Homebrew installations between Macs via Dropbox
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
@brasofilo
brasofilo / old-upload-method.php
Last active October 5, 2018 18:11
Replace the New WP 3.5 Uploader with the Old Thickbox
<?php
/**
* Plugin Name: Old Upload Method
* Plugin URI: http://wordpress.org/support/topic/is-there-a-way-to-disable-the-new-media-manager
* Description: Replace the new media upload with the old thickbox
* Author: A.Morita, brasofilo
* Version: 1.2
* License: GPLv2 or later
*
@pgodino
pgodino / GPUImageMovie.h
Created October 2, 2012 15:06
Play audio with movie
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "GPUImageOpenGLESContext.h"
#import "GPUImageOutput.h"
#import "TPCircularBuffer.h"
#ifndef max
#define max( a, b ) ( ((a) > (b)) ? (a) : (b) )
#endif
@adamgit
adamgit / .gitignore
Last active April 8, 2024 12:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@ashsmith
ashsmith / .gitignore
Last active April 22, 2022 00:06
Magento 1.x .gitignore
# Never save database creditentials in your repo. Keep a dummy copy with a different name eg "local.xml.dev"
app/etc/local.xml
downloader
# If you'd like to keep the downloader, use the following instead:
# downloader/.cache
# downloader/cache.cfg
# downloader/connect.cfg
# All of the var folders can be excluded.