This file contains hidden or 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
// frameRate padrão será 25fps | |
CanvasRenderingContext2D.prototype.frameRate = 1000/25 | |
// setFrameRate(rate) | |
// @rate: frame rate a ser utilizado (em quadros por segundo - fps -) (ex: 30) | |
CanvasRenderingContext2D.prototype.setFrameRate = function(rate) | |
{ | |
// transforma o frame rate passado de quadros por segundo para ms | |
this.frameRate = Math.round(1000/rate); | |
return this.frameRate; |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or 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
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) | |
ro_MD Romanian (Moldova) |
This file contains hidden or 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
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
This file contains hidden or 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
BOOL isDarkImage(UIImage* inputImage){ | |
BOOL isDark = FALSE; | |
CFDataRef imageData = CGDataProviderCopyData(CGImageGetDataProvider(inputImage.CGImage)); | |
const UInt8 *pixels = CFDataGetBytePtr(imageData); | |
int darkPixels = 0; | |
int length = CFDataGetLength(imageData); |
This file contains hidden or 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
<?php | |
// retorna array contendo informacoes e um array de numeros aleatórios | |
// num -> quantidade de numeros que deve gerar | |
// amount -> número máximo que pode ser gerado | |
// force_pseudo -> não utilizar o serviço random.org e gerar números pseudo-aleatórios | |
function get_random_numbers($num, $amount, $force_pseudo=false) | |
{ | |
// verifica a quota do servidor com o random.org para ver se é seguro fazer uma requisição agora | |
$c_quota = curl_init("http://www.random.org/quota/?format=plain"); | |
curl_setopt($c_quota, CURLOPT_RETURNTRANSFER, true); |
This file contains hidden or 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 | |
AD_HOC_CODE_SIGNING_ALLOWED | |
ALTERNATE_GROUP | |
ALTERNATE_MODE | |
ALTERNATE_OWNER | |
ALWAYS_SEARCH_USER_PATHS | |
ALWAYS_USE_SEPARATE_HEADERMAPS | |
APPLE_INTERNAL_DEVELOPER_DIR | |
APPLE_INTERNAL_DIR | |
APPLE_INTERNAL_DOCUMENTATION_DIR |
This file contains hidden or 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 <Foundation/Foundation.h> | |
// Useful references: | |
// -[SMProcess webKitActiveURLs] implementation used in Activity Monitor on 10.9 (search for it using Hopper) | |
// http://opensource.apple.com/source/WebKit2/WebKit2-7537.71/WebProcess/mac/WebProcessMac.mm | |
// https://github.com/rodionovd/RDProcess/blob/master/RDProcess.m | |
const CFStringRef kLSActivePageUserVisibleOriginsKey = CFSTR("LSActivePageUserVisibleOriginsKey"); | |
const int kLSMagicConstant = -1; |
This file contains hidden or 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
operator infix --> {} | |
func --> (instance: Any, key: String) -> Any? { | |
let mirror = reflect(instance) | |
for index in 0 ..< mirror.count { | |
let (childKey, childMirror) = mirror[index] | |
if childKey == key { | |
return childMirror.value | |
} | |
} |
This file contains hidden or 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
## Collection of posts/videos I've found useful while researching mvvm | |
https://speakerdeck.com/jspahrsummers/code-reuse-with-mvvm | |
http://cocoasamurai.blogspot.com/2013/03/basic-mvvm-with-reactivecocoa.html | |
http://www.teehanlax.com/blog/model-view-viewmodel-for-ios/ | |
http://martinfowler.com/eaaDev/PresentationModel.html | |
http://twocentstudios.com/blog/2014/06/08/on-mvvm-and-architecture-questions/ |
This file contains hidden or 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
#!/bin/sh | |
say "Warming up the pitch engine..." | |
for word in `sort -R /usr/share/dict/words` | |
do | |
PITCH="It's like Uber for $word." | |
echo $PITCH | |
say $PITCH | |
sleep 1 | |
done |
OlderNewer