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 python | |
# -*- coding: utf-8 -*- | |
import readline | |
class Developer(object): | |
def __init__(self, name, email, skills): | |
self.name = name | |
self.email = email |
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
// ParseClientConfiguration.h | |
@protocol ParseMutableClientConfiguration <NSObject> | |
@property (nonatomic, assign) BOOL allowInvalidCertificate; | |
@end | |
@interface ParseClientConfiguration : NSObject <NSCopying> | |
@property (nonatomic, assign, readonly) BOOL allowInvalidCertificate; | |
@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
class Foo(object): | |
def bar(self): | |
return 'bar' | |
def new_bar(self, super_method): | |
if super_method is not None: | |
return ', '.join([super_method(), 'new_bar']) | |
return 'new_bar' |
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
#!/bin/bash | |
generate-self-signed-certificate () { | |
if [[ $1 ]]; then | |
openssl req -nodes -x509 -newkey rsa:2048 -keyout $1.key -out $1.crt -days 3650 | |
return 0 | |
fi | |
echo -e "\033[0;31mPlease provide the name of the key.\033[0m" 1>&2 | |
return 1 | |
} |
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
# PUT it to `classes/_Role/roleID` | |
{ | |
"users": { | |
"__op": "AddRelation", | |
"objects": [ | |
{ | |
"__type": "Pointer", | |
"className": "_User", | |
"objectId": "objectId" |
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 Foundation | |
//: Playground - noun: a place where people can play | |
import UIKit | |
func random(lessThan aNumber: Int) -> Int { | |
return Int(arc4random_uniform(UInt32(aNumber))) | |
} |
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
// Unicode to 7-bit GSM | |
const write = 'Hello, Faisalman!'; | |
const msgSubmit = Array.from(write) | |
.map(char => Unicode2GSM[char].toString(16)) | |
.join(' '); | |
console.log(msgSubmit); // "48 65 6C 6C 6F 2C 20 46 61 69 73 61 6C 6D 61 6E 21" | |
// 7-bit GSM to Unicode | |
const read = "48 65 6C 6C 6F 2C 20 46 61 69 73 61 6C 6D 61 6E 21"; | |
const msgReceived = read.split(' ') |
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
const rp = require('request-promise-native'); | |
const https = require('https'); | |
const querystring = require('querystring'); | |
const iconv = require('iconv-lite'); | |
const baseUrl = 'https://www.meteorsis.com/misweb/'; | |
const MeteorsisApiErrorCodeMap = { |
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
class Combinator<Object>: IteratorProtocol { | |
typealias Element = [Object] | |
var objects: [Object] | |
var numberOfSelection: Int | |
private var currentIndexes: [Int] | |
private var done = false | |
func next() -> [Object]? { | |
guard !currentIndexes.isEmpty else { return nil } |
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
#!/bin/bash | |
if [ `id -u` != "0" ]; then | |
echo "Error: Must run as root" | |
exit 1 | |
fi | |
VERSION=${1:-1.1.0} | |
URL_BASE="http://storage.googleapis.com/downloads.webmproject.org/releases/webp/" |