Skip to content

Instantly share code, notes, and snippets.

View chrisl777's full-sized avatar

Chris Livdahl chrisl777

View GitHub Profile
@abury
abury / complex_iOS_build_script.sh
Created November 29, 2011 11:44
An extended iOS build Script showing a range of functions
#!/bin/sh
# Extended iOS Build Script
# Written by Aron Bury, 29/11/2011
#==== Script Params =====
# App params
appname="AwesomeApp"
target_name="$appname"
sdk="iphoneos"
@YooWaan
YooWaan / DSAppDelegate.m
Created March 27, 2012 06:28
EmittingCell Sample
//
// DSAppDelegate.m
// DrawSmoke
//
// Created by developer on 12/03/27.
// Copyright (c) 2012 your good mind. All rights reserved.
//
#import "DSAppDelegate.h"
#import <QuartzCore/QuartzCore.h>
@kaloprominat
kaloprominat / xcode objective-c GCD dispatch group wait example
Last active August 5, 2023 10:50
xcode objective-c GCD dispatch group wait example
//first
dispatch_async(queue, ^{
dispatch_group_t group1 = dispatch_group_create();
// Tasks goes here
for (NSInteger i = 0; i < 3; i++) {
@paambaati
paambaati / launch.js
Last active May 5, 2022 05:35
Debug mocha tests using Visual Studio Code
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
// ONLY "node" and "mono" are supported, change "type" to switch.
"configurations": [
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "Run app.js",
// Type of configuration. Possible values: "node", "mono".
"type": "node",
@iest
iest / README.md
Last active August 11, 2022 09:20
Setting up environment variables with various shells

What the hell are environment variables?

They're just variables you set on your system that various programs/processes can read. A fairly standard example in javascript circles would be setting your NODE_ENV variable to "production" or "development", altering how node code is executed on your system (for example showing more debug messaging when in development).

With most shells there's a way to set them for the current session, and a way to set them for all sessions. The following is meant to be a guide on how to set env vars in the various shells.

Bash (The default shell on OSX)

Setting for the session:

1. Build GraphQL server using `express-graphql` package.
2. Configure `schema.js` file.
3. Query for data.
@jsdf
jsdf / __tests__getStuff-test.js
Last active August 30, 2020 20:02
Writing and testing async JS with Jest, promises and async functions
jest.dontMock('../getStuff');
describe('getStuff', () => {
let getStuff;
let request;
let stuffStore;
it('loads the data', () => {
const id = 1;
const data = {a: 1};
@darthpelo
darthpelo / MyProjectTests.swift
Created August 22, 2016 09:53
How to setup a UIViewController and test it with Unit Test (Swift 3)
import XCTest
@testable import MyProject
class MyProjectTests: XCTestCase {
var mainvc: MyProject.ViewController!
private func setUpViewControllers() {
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
@VivienGiraud
VivienGiraud / Swift 3 - Dijkstra.swift
Created October 27, 2016 09:39 — forked from pocketkk/Swift - Dijkstra.swift
Swift 3 - Shortest Path Algorithm (Compiled from: http://waynewbishop.com/swift/graphs/dijkstra/)
import UIKit
public class Vertex {
var key: String?
var neighbors: Array<Edge>
init() {
self.neighbors = Array<Edge>()
}
}
@nblackburn
nblackburn / camelToKebab.js
Last active December 15, 2023 03:19
Convert a string from camel case to kebab case.
module.exports = (string) => {
return string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
};