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
pub const EntityType = enum { variable, array, object }; | |
pub const Variable = struct { name: []const u8, value: []const u8 }; | |
pub const Array = struct { name: []const u8, content: []const Variable }; | |
pub const Object = struct { name: []const u8, fields: []const Variable }; | |
pub const Entity = union(EntityType) { variable: Variable, array: Array, Object: 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
#!/usr/bin/env sh | |
# http://stackoverflow.com/a/30819570/187663 | |
ffmpeg -i $1 -i $1 -filter_complex "[0:v]scale=-1:720[scaled_video];[1:v]scale=1280:720,boxblur=16[blur_image];[blur_image][scaled_video]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2[outv]" -c:v libx264 -aspect 1280/720 -map [outv] -map 0:a -c:a copy $1.fixed.mp4 |
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
// Updated to Swift 1.2 and CocoaLumberjack 2.0.0-rc by Stan Serebryakov on 2015-02-16 | |
import Foundation | |
extension DDLog { | |
private struct State { | |
static var logLevel: DDLogLevel = .Error | |
static var logAsync: Bool = true | |
} |
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 | |
import dropbox | |
import os | |
import time | |
file_path = "/opt/backups/backup.tar.gz" | |
dest_path = "/Apps/backup/" | |
dbx = dropbox.Dropbox("<app-token>") | |
dest_today_path = dest_path + time.strftime("%Y-%m-%d") + ".tgz" |
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
# Just copy paste if you want more chests. The percentages for chests must add up to 100! | |
config: | |
enabled: true | |
modes: | |
chests: true | |
items: false | |
chests: | |
chest1: | |
items: 5*64;5*64;5*64;5*64;262*64;278*1;5*64%30 | |
percentage: 5 |
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
{-# LANGUAGE OverloadedStrings, RecordWildCards #-} | |
import Data.Text hiding (filter, unwords) | |
import Pipes | |
import Data.IORef | |
import Data.Maybe | |
import Data.Time (UTCTime(..), getCurrentTime) | |
import qualified Data.Map.Strict as M |
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
// cfr.pw | |
#include "JG.h" | |
#include "DungeonGenerator.h" | |
ADungeonGenerator::ADungeonGenerator() { | |
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. | |
PrimaryActorTick.bCanEverTick = true; | |
RootComponent = CreateDefaultSubobject<USceneComponent>("SceneRoot"); |
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::hashmap::HashMap; | |
fn main() { | |
// create a hashmap | |
let mut hm = HashMap::new(); | |
hm.insert(~"foo", 10); | |
hm.insert(~"bar", 23); | |
hm.insert(~"baz", 99); | |
hm.insert(~"meh", 2); | |
hm.insert(~"muh", -13); |
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
#define printf_dec_format(x) _Generic((x), \ | |
char: "%c", \ | |
signed char: "%hhd", \ | |
unsigned char: "%hhu", \ | |
signed short: "%hd", \ | |
unsigned short: "%hu", \ | |
signed int: "%d", \ | |
unsigned int: "%u", \ | |
long int: "%ld", \ | |
unsigned long int: "%lu", \ |
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
typedef void (^OpCompletionEither)(BOOL success); | |
- (void)sequence:(NSArray *)selectors | |
withFinalBlock:(OpCompletionEither)block { | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Warc-performSelector-leaks" | |
__block OpCompletionEither _block = block; | |
SEL selector = NSSelectorFromString(selectors[0]); | |
if (selectors.count == 1) | |
// last request, perform reply block |
NewerOlder