Skip to content

Instantly share code, notes, and snippets.

View dtinth's full-sized avatar
🎶
𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪

Thai Pangsakulyanont dtinth

🎶
𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪
  • @bemusic                 @creatorsgarten                 @eventpop                 @showdownspace                 @spacetme                @wonderfulsoftware                
  • Krungthepmahanakhonamonrattanakosinmahintharayutthayamahadilokphopnoppharatratchathaniburiromudomratchaniwetmahasathanamonphimanawatansathitsakkathattiyawitsanukamprasit (Bangkok), Thailand
  • YouTube @dtinth
View GitHub Profile
@dtinth
dtinth / dtinth.json
Created June 5, 2014 01:31
Powerline color scheme for Vim
{
"name": "Default color scheme",
"groups": {
"background": { "fg": "white", "bg": "gray2" },
"background:divider": { "fg": "gray6", "bg": "gray2" },
"mode": { "fg": "darkestgreen", "bg": "brightgreen", "attr": ["bold"] },
"modified_indicator": { "fg": "brightyellow", "bg": "gray4", "attr": ["bold"] },
"paste_indicator": { "fg": "white", "bg": "mediumorange", "attr": ["bold"] },
"readonly_indicator": { "fg": "gray6", "bg": "gray4" },
"branch": { "fg": "gray9", "bg": "gray4" },
@dtinth
dtinth / dtinth.json
Created June 5, 2014 01:33
Powerline theme for Tmux
{
"default_module": "powerline.segments.common",
"segment_data": {
"uptime": {
"before": "⇑ "
},
"external_ip": {
"before": "ⓦ "
},
"date": {
@dtinth
dtinth / dtinth.json
Created June 5, 2014 01:34
Powerline theme for Vim
{
"segment_data": {
"branch": {
"before": " "
},
"modified_indicator": {
"args": { "text": "+" }
},
"line_percent": {
"args": { "gradient": false },
@dtinth
dtinth / config.json
Created June 5, 2014 01:35
Powerline config.json
{
"common": {
"term_truecolor": false,
"dividers": {
"left": {
"hard": " ",
"soft": " "
},
"right": {
"hard": " ",
require 'watir-webdriver'
puts "== Album Description Updater =="
description = File.read(ARGV[0])
parts = description.scan(/https:\/\/www\.facebook\.com\/.*?\/media_set\S+/)
puts "There are #{parts.length} albums whose descriptions are to be updated!"
browser = Watir::Browser.new :firefox, :profile => 'watir'
@dtinth
dtinth / title.rb
Last active September 1, 2017 10:07
require 'base64'
require 'erb'
title, subtitle, *text, image_number = ARGV
output_file = "image%02d.cover.png" % [image_number.to_i]
html = ERB.new(File.read('title.template.html.erb')).result(binding)
data_url = "data:text/html;base64,#{Base64.strict_encode64(html)}"
RASTERIZE = "/usr/local/share/phantomjs/examples/rasterize.js"
<!DOCTYPE html><meta charset=utf-8>
<style>
body { padding: 0; margin: 0; }
#outer {
width: 1632px; height: 1224px;
color: white; background: black;
font: bold 192px/1.3 Helvetica Neue, sans-serif;
position: relative;
}
#inner {
require 'osaka'
require 'growl'
def get_player_position
Osaka::ScriptRunner.execute(%q(tell application "iTunes" to get the player position)).to_f
end
def get_track_description
Osaka::ScriptRunner.execute(%q(tell application "iTunes" to get the current track's long description))
s = Time.now
wc = `pbpaste | wc -w`.to_i
print "#{wc} words"
gets
t = (Time.now - s).to_i
puts "#{t} seconds"
puts "#{wc * 60 / t} wpm"
#! /usr/bin/python
"""
This simple script makes it easy to create server certificates
that are signed by your own Certificate Authority.
Mostly, this script just automates the workflow explained
in http://www.tc.umn.edu/~brams006/selfsign.html.
Before using this script, you'll need to create a private