Skip to content

Instantly share code, notes, and snippets.

View chunkyguy's full-sized avatar

Sidharth Juyal chunkyguy

View GitHub Profile
@tomaszpolanski
tomaszpolanski / golden_files_test.dart
Last active October 5, 2020 10:13
Golden Files testing in Flutter
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
setUp(() {
// Limits viewport in tests to size of 100, 100 to decrease the size of
// the pngs
WidgetsBinding.instance.renderView.configuration =
TestViewConfiguration(size: const Size(100, 100));
});
@maluoi
maluoi / colorspace_cubehelix.cpp
Created November 11, 2020 03:20
Converts cubehelix HSL to RGB
// Reference here: http://www.mrao.cam.ac.uk/~dag/CUBEHELIX/
skg_color128_t skg_col_helix128(float h, float s, float l, float alpha) {
const float tau = 6.28318f;
l = fminf(1,l);
float angle = tau * (h+(1/3.f));
float amp = s * l * (1.f - l);
float a_cos = cosf(angle);
float a_sin = sinf(angle);
float r = l + amp * (-0.14861f * a_cos + 1.78277f * a_sin);
@codelynx
codelynx / simd+ext.swift
Last active November 17, 2021 18:56
swift: float4x4 extension to scale, rotate, translate 4x4 matrix
//
// simd+ext.swift
//
// Created by Kaz Yoshikawa on 11/6/15.
//
//
import Foundation
import simd
import GLKit
@kgrz
kgrz / workaround.md
Created June 20, 2016 05:12
Possible workaround for installing nokogiri 1.6.8 on OSX with brewed libxml2 2.9.4

Problem:

The following commands fail on OSX:

gem install nokogiri
gem install nokogiri -- --use-system-libraries
gem install nokogiri -- --use-system-libraries --with-xslt-dir=/usr/local/opt/libxslt --with-xml2-dir=/usr/local/opt/libxml2

Version:

@Josh-Tucker
Josh-Tucker / feeds.opml
Last active July 7, 2023 15:14
HN User Blogroll OPML
<?xml version='1.0' encoding='utf-8'?>
<opml version="1.0">
<head />
<body>
<outline text="https://xeiaso.net" type="rss" xmlUrl="https://xeiaso.net/blog.rss" />
<outline text="https://fasterthanli.me/" type="rss"
xmlUrl="https://fasterthanli.me/index.xml" />
<outline text="https://matt-rickard.com" type="rss" xmlUrl="/rss/" />
<outline text="https://jmmv.dev/" type="rss" xmlUrl="/feed.xml" />
<outline text="https://paulstamatiou.com" type="rss"
@JSchaenzle
JSchaenzle / RapidXmlExample.c
Created May 18, 2012 18:37
RapidXml example parsing beer journal
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include "rapidxml-1.13/rapidxml.hpp"
using namespace rapidxml;
using namespace std;
@douglashill
douglashill / main.m
Last active October 6, 2023 18:10
A minimal iOS 13 app that is set up in Objective-C rather than using a storyboard and UIApplicationSceneManifest
@import UIKit;
@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>
@end
@implementation SceneDelegate
@synthesize window = _window;
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
@mmorris
mmorris / wwdc_2012_urls.txt
Created July 7, 2016 13:41
WWDC 2012 HD video URL list
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_307__building_great_newsstand_apps.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_311__building_and_distributing_custom_b2b_apps_for_ios.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_304__events_and_reminders_in_event_kit.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_300__getting_around_using_map_kit.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_306__integrating_with_facebook_twitter_and_sina_weibo.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_301__introducing_passbook_part_1.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_309__introducing_passbook_part_2.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_3
@cotkjaer
cotkjaer / CGRect+Center.swift
Last active November 23, 2023 06:15
Swift extensions to add "center" to CGRect
extension CGRect
{
/** Creates a rectangle with the given center and dimensions
- parameter center: The center of the new rectangle
- parameter size: The dimensions of the new rectangle
*/
init(center: CGPoint, size: CGSize)
{
self.init(x: center.x - size.width / 2, y: center.y - size.height / 2, width: size.width, height: size.height)
@adamgit
adamgit / gist:3705459
Last active December 11, 2023 16:27
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)