# clipping
ffmpeg -ss 00:00:15 -to 00:00:18 -i test.mov -c copy out.mov
# video to gif
ffmpeg -i out.mov -vf "fps=10,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
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
from PIL import Image | |
original_11 = "1024.png" | |
original_43 = "1024x768.png" | |
im = Image.open(original_11) | |
variants_11 = [ | |
58, | |
87, |
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
-- Source:https://github.com/owenlo/Marble-Hammerspoon | |
-- Source:https://github.com/tekezo/Karabiner/issues/814#issuecomment-415388742 | |
-- Source:https://gist.github.com/ParatechX/c03c1146f7cd719dbfd65a337c7228f3 | |
-- HANDLE SCROLLING WITH MOUSE BUTTON PRESSED | |
local backMouseButton = 3 | |
local forwardMouseButton = 4 | |
local deferred = false | |
local VSCODE = 'Code' | |
local VIM = 'MacVim' |
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 | |
# Copyright 2017 Google Inc. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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 os, sys, json, math | |
svg_width = 512 | |
svg_height = 512 | |
margin_x = svg_width / 10.0 | |
margin_y = svg_height / 10.0 | |
font_size = 16 | |
charge_stroke_width=2.0 |
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 os | |
from datetime import datetime | |
# Downloaded files from Google Photo have time in UTC. | |
# I want to change them to use my local timezone. | |
tzdiff = 3600 * 9 # my timezone is +09:00 | |
for f in os.listdir('.'): | |
if '.JPG' in f or '.jpg' in f: | |
stinfo = os.stat(f) |
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
/* https://dashboard.tapjoy.com/dashboard/v2/advertise/list?start=2017-05-23&end=2017-05-27&granularity=1.day&range=custom */ | |
/* use this site to create bookmarklet - http://mrcoles.com/bookmarklet/ */ | |
require.s.contexts._.defined['lib/models/ad_filter'].prototype.computeDates = function(range) { | |
var dateFormat, endDate, endDateString, isOneDayHourly, number_and_word_range, startDate, startDateString, timezone; | |
if (range == null) { | |
range = null | |
} | |
range || (range = this.get("range")); | |
number_and_word_range = /^(\d+)(\w+)$/.exec(range); |
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
using UnityEngine; | |
using System.Collections; | |
using TapjoyUnity; | |
public class Tapjoy1 : MonoBehaviour { | |
int count = 0; | |
TJPlacement p; | |
// Use this for initialization | |
void Start () { |
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
#include "rapidjson/document.h" | |
#include "rapidjson/writer.h" | |
#include "rapidjson/stringbuffer.h" | |
#include <cstdio> | |
#include <string> | |
#include <iostream> | |
//#include <regex> | |
#include <boost/regex.hpp> | |
using namespace rapidjson; |
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
from PIL import Image | |
im = Image.open("ic_notify.png") | |
out = Image.new("RGBA", (96, 96)) | |
pix = out.load() | |
blank = (0, 0, 0, 0) | |
white = (255, 255, 255, 255) |
NewerOlder