Skip to content

Instantly share code, notes, and snippets.

View julien-c's full-sized avatar
Real artists ship

Julien Chaumond julien-c

Real artists ship
View GitHub Profile
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@nathanpc
nathanpc / index.html
Created November 21, 2011 22:52
Example of NativeControls in PhoneGap
<!DOCTYPE html>
<html>
<head>
<title>NativeControls Example</title>
<!-- PhoneGap Stuff -->
<script src="phonegap-1.0.0.js" type="text/javascript" charset="utf-8"></script>
<script src="NativeControls.js" type="text/javascript" charset="utf-8"></script>
<!-- /PhoneGap Stuff -->
@veritech
veritech / social.m
Created September 19, 2012 20:37
How to use iOS 6's social framework
/*
* This code uses the Social.framework & the AFNetworking library
*/
ACAccountStore *store;
ACAccountType *accountType;
//Create an ACAccountStore instance
store = [[ACAccountStore alloc] init];
@arthurdarcet
arthurdarcet / gist:6728522
Created September 27, 2013 13:23
Variadic function in Objective-C
- (void)fun:(NSString *)first, ...
{
va_list args;
va_start(args, first);
for (NSString* arg = first; arg != nil; arg = va_arg(args, NSString*))
NSLog(@"var: %@", arg);
va_end(args);
}
@cromandini
cromandini / universal-framework.sh
Last active November 9, 2024 08:56 — forked from cconway25/gist:7ff167c6f98da33c5352
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
@natecook1000
natecook1000 / NSTimer+Closure.swift
Last active July 12, 2024 05:11
Scheduled NSTimer with a Swift closure
extension NSTimer {
/**
Creates and schedules a one-time `NSTimer` instance.
- Parameters:
- delay: The delay before execution.
- handler: A closure to execute after `delay`.
- Returns: The newly-created `NSTimer` instance.
*/
@aditya-malte
aditya-malte / smallberta_pretraining.ipynb
Created February 22, 2020 13:41
smallBERTa_Pretraining.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sshleifer
sshleifer / PreTweet Checklist
Created May 15, 2020 16:02
Before you tweet checklist
- for mention in tweet.grep('@'): assert twitter.get(mention) == expected_person
- assert photo has tags
- if thread: numbers make sense or down emoji
- all links work
- read it over once more
@julien-c
julien-c / ModelInfo.ts
Last active October 15, 2020 20:46
Model tag <=> pipeline type logic, for public reference
export class ModelInfo {
/**
* Key to config.json file.
*/
key: string;
etag: string;
lastModified: Date;
size: number;
modelId: ModelId;
author?: AuthorId;
@hervenivon
hervenivon / boto3_multipartupload.py
Created November 18, 2020 21:31
Upload large files in multi part
import boto3
import os
import sys
import threading
from boto3.s3.transfer import TransferConfig
s3_client = boto3.client('s3')
# S3 transfer documentation: https://boto3.amazonaws.com/v1/documentation/api/1.9.156/reference/customizations/s3.html?highlight=transferconfig#boto3.s3.transfer.TransferConfig