This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stage 1: Build | |
FROM debian:latest AS build-env | |
# Install flutter dependencies | |
RUN apt-get update | |
RUN apt-get install -y curl git wget unzip libgconf-2-4 gdb libstdc++6 libglu1-mesa fonts-droid-fallback python3 sed | |
RUN apt-get clean | |
# Clone the flutter repo | |
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bleno = require('bleno'); | |
bleno.on('stateChange', function(state) { | |
console.log('State change: ' + state); | |
if (state === 'poweredOn') { | |
console.log('advertising') | |
bleno.startAdvertising('MyPeripheral',['12ab']); | |
} else { | |
bleno.stopAdvertising(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"action" : "talk", | |
"text": "Emergency announcement #2, Peter is presenting on stage, hope it's not a disaster!" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task uploadTf(dependsOn: assembleRelease) << { | |
def teamToken = '<TestFlight team token here>' | |
def apiToken = '<TestFlight api token here>' | |
def lists = '<TestFlight distribution lists here>' | |
def apk = file("build/apk/$project.name-release.apk") | |
def notes = new File(file('changelog.mdown')).getText("UTF-8") | |
def http = new HTTPBuilder('http://testflightapp.com') | |
println('Uploading build to TestFlight...') | |
http.request(POST, JSON) { req -> | |
uri.path = '/api/builds.json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-to-list 'load-path "~/.emacs.d") | |
(require 'cc-mode) | |
(require 'autopair) | |
(autopair-global-mode) | |
(define-key c-mode-base-map (kbd "RET") 'newline-and-indent) | |
(global-linum-mode t) | |
(setq-default c-basic-offset 4 | |
tab-width 8 | |
indent-tabs-mode t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'RMagick' | |
def resize_image (image_path, write_path) | |
image = Magick::Image.read(image_path).first | |
new_image = image.scale(0.5) | |
puts "Writing image #{write_path}..." | |
new_image.write(write_path) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UIView (Utils) | |
-(UIViewController *)parentViewController; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+(UIView *)fetchViewFromNib:(NSString *)nibName withClass:(Class)viewClass { | |
NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil]; | |
UIView *view = nil; | |
for (id object in nibObjects) { | |
if ([object isKindOfClass:viewClass]) { | |
view = object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+(UIView *)fetchViewFromNib:(NSString *)nibName withClass:(Class)viewClass { | |
NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil]; | |
UIView *view = nil; | |
for (id object in nibObjects) { | |
if ([object isKindOfClass:viewClass]) { | |
view = object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]; | |
[NSURLCache setSharedURLCache:sharedCache]; | |
[sharedCache release]; |
NewerOlder