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 sh | |
# Check if exactly 2 arguments are given | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 input_filename.ts output_filename.mp4" | |
exit 1 | |
fi | |
input_file="$1" | |
output_file="$2" |
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
use exif::{DateTime, Field, Reader}; | |
use regex::Regex; | |
use std::env; | |
use std::fs::File; | |
use std::io::{BufReader, Error}; | |
use std::path::PathBuf; | |
use walkdir::WalkDir; | |
fn main() -> Result<(), Error> { | |
let re = Regex::new(r"\.(jpg|jpeg|png|gif|mp4|mov)$").unwrap(); |
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
use std::env; | |
use std::fs; | |
use std::fs::File; | |
use std::io::BufReader; | |
use std::path::PathBuf; | |
use exif::{In, Reader, Tag}; | |
fn main() { | |
let args: Vec<String> = env::args().collect(); |
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
//: [Previous](@previous) | |
/*: | |
# Mutation | |
To test class mutation in Swift. | |
The same behaviour as Kotlin, when the class has mutable properties. | |
*/ |
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
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ | |
class Node(name: String) { | |
var position: FloatArray = floatArrayOf(0.0f, 0.0f, 0.0f) | |
var rotation: FloatArray = floatArrayOf(0.0f, 0.0f, 0.0f, 0.0f) | |
var name: String = name | |
var children: Array<Node> = emptyArray() |
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 <Cocoa/Cocoa.h> | |
@interface NSColor (isLight) | |
- (BOOL)isLight; | |
@end |
I hereby claim:
- I am jessearmand on github.
- I am jessearmand (https://keybase.io/jessearmand) on keybase.
- I have a public key ASD5t-v5WMuSFh19tH9pKmg2hcXYuEIMY0nOOhjh7OnWxgo
To claim this, I am signing this 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
function slow_hash(str) { | |
var hash = 0, i, chr, len; | |
if (str.length === 0) return hash; | |
for (i = 0, len = str.length; i < len; i++) { | |
chr = str.charCodeAt(i); | |
hash = ((hash << 5) - hash) + chr; | |
hash |= 0; // Convert to 32bit integer | |
// max of integer in javascript is 2^53 | |
// http://stackoverflow.com/questions/307179/ |
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 | |
class Answer { | |
let questionId = 0 | |
let answerId = 0 | |
let answer: String? | |
} | |
public class Question { | |
let questionId = 0 |
NewerOlder