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 CoreMediaIO | |
extension CMTimeFlags: CustomStringConvertible { | |
public var description: String { | |
let flags : [(CMTimeFlags, String)] = [ | |
(.valid, "valid"), | |
(.hasBeenRounded, "hasBeenRounded"), | |
(.positiveInfinity, "positiveInfinity"), | |
(.negativeInfinity, "negativeInfinity"), | |
(.indefinite, "indefinite"), |
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 CryptoKit | |
import Foundation | |
// https://stackoverflow.com/questions/56828125/how-do-i-access-the-underlying-key-of-a-symmetrickey-in-cryptokit | |
extension SymmetricKey { | |
init(base64Encoded: String) { | |
self.init(data: Data(base64Encoded: base64Encoded)!) | |
} | |
var base64Encoded: String { |
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
# remove all images | |
$ docker rmi `docker images |sort -r| grep -v "^REPOSITORY" | awk '{print $3}'` | |
# remove all containers | |
$ docker rm `docker ps -a | awk '{print $1}'` | |
# min ubuntu image | |
$ mkdir /home/vagrant/new | |
$ debootstrap --variant=minbase --arch=amd64 precise /home/vagrant/new http://192.168.1.50:3142/ubuntu | |
$ cd /home/vagrant/new | |
$ tar cvfz ../min.tgz . |
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
test 'gets index as json' do | |
user1 = user2 = nil | |
without_access_control do | |
User.destroy_all | |
user1 = FactoryGirl.create(:user, role: "user") | |
user2 = FactoryGirl.create(:user, role: "admin") | |
end | |
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 | |
function calculate_total($haehnchen_preis, $haehnchen_anzahl) { | |
$mein_profit = 100; | |
return $haehnchen_preis * $haehnchen_anzahl + $mein_profit; | |
} | |
?> |
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
(in /Users/thieso/zips/plat_forms_2011) | |
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Controllers | 471 | 384 | 14 | 50 | 3 | 5 | | |
| Helpers | 41 | 38 | 0 | 5 | 0 | 5 | | |
| Models | 522 | 416 | 11 | 45 | 4 | 7 | | |
| Libraries | 30 | 27 | 1 | 3 | 3 | 7 | | |
| Integration tests | 64 | 49 | 3 | 1 | 0 | 47 | | |
| Functional tests | 592 | 478 | 8 | 1 | 0 | 476 | |
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
New file: inline_levenshtein | |
inline do |builder| | |
builder.add_link_flags '-lruby' | |
builder.c_raw <<-EOT | |
long minimum(long a,long b,long c) | |
/*Gets the minimum of three values*/ | |
{ | |
long min=a; | |
if(b<min) |
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
diff --git a/ext/perftools.c b/ext/perftools.c | |
index e6f97f1..ace2e01 100644 | |
--- a/ext/perftools.c | |
+++ b/ext/perftools.c | |
@@ -159,6 +159,8 @@ static VALUE Isend; | |
case VM_FRAME_MAGIC_CFUNC: | |
self = cfp->self; | |
#ifdef HAVE_METHOD_H | |
+ if (! cfp->me) break; | |
+ |
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
[mysqld] | |
max_allowed_packet = 16M | |
innodb_file_per_table | |
query_cache_size = 32M | |
innodb_additional_mem_pool_size = 256M | |
innodb_buffer_pool_size = 512M | |
innodb_log_buffer_size = 256M | |
innodb_log_file_size = 256M | |
#bulk_insert_buffer_size = 256M | |
innodb_flush_method = O_DSYNC |
NewerOlder