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
#!/bin/sh | |
# Convert video to gif. | |
if [[ $# -ne 3 ]]; then | |
echo "Usage: trans_gif source.mp4 target.gif 300" | |
exit 1 | |
fi | |
palette="/tmp/palette.png" | |
filters="fps=15,scale=$3:-1:flags=lanczos" |
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/ruby | |
exit(0) if File.exists?('/root/.jlpt_sent') | |
require 'net/https' | |
require 'json' | |
require 'open-uri' | |
require 'hpricot' | |
SLACK_URL = "https://hooks.slack.com/services/xxxxx" |
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
Incident Identifier: 2D2808D0-F71F-4C68-AFDD-639175C4239E | |
CrashReporter Key: 153f5645627079591a0e528446a69296c17f523e | |
Hardware Model: iPhone7,1 | |
Process: SwiftyGohan [2132] | |
Path: /private/var/containers/Bundle/Application/B8888313-A544-4101-8868-62BE35A49A4E/SwiftyGohan.app/SwiftyGohan | |
Identifier: me.imach.SwiftyGohan | |
Version: 596 (2.2) | |
Code Type: ARM-64 (Native) | |
Parent Process: launchd [1] |
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 bash | |
# Original: http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html | |
V_BUILD=/Volumes/install_build | |
V_APP=/Volumes/install_app | |
T_SI_B=/tmp/mavericks | |
T_SI=$T_SI_B.sparseimage |
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
#!/bin/sh | |
# | |
# Use posixregex CLI tool from: https://github.com/syzdek/dmstools/blob/master/src/posixregex.c | |
RE_IPV4="((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])" | |
posixregex -r "^(${RE_IPV4})$" \ | |
127.0.0.1 \ | |
10.0.0.1 \ | |
192.168.1.1 \ |
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
//: Playground - noun: a place where people can play | |
import Foundation | |
import Darwin | |
let regex = UnsafeMutablePointer<regex_t>.alloc(1) | |
let regexString = "^[[:alnum:]]+$" | |
let regex_str = regexString.cStringUsingEncoding(NSUTF8StringEncoding)! | |
if (regcomp(regex, regex_str, REG_ICASE | REG_EXTENDED) != 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <regex.h> | |
#include <unicode/uregex.h> | |
int main(int argc, char const *argv[]) | |
{ | |
regex_t regex; | |
if (regcomp(®ex, "\\w+", REG_ICASE | REG_EXTENDED)) { | |
printf("Error compile\n"); |
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 ruby | |
require 'twitter' | |
require 'open-uri' | |
require 'open_uri_redirections' | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = "riOPILJqG0AtzB8x7hiqRA" | |
config.consumer_secret = "uBlaPxB3QONvCyvvq78CY9UjpHYdxYdeEb0d1QAaU" | |
config.access_token = "191735866-EHC4Xbf5O6fSu62CI72Hk1PPQ6d0Jn81sMWkWF9p" |
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 ruby | |
require 'fileutils' | |
require 'shellwords' | |
include FileUtils | |
#hdiutil makehybrid -iso -joliet -o image.iso /path/to/source | |
ARGV.each do |rootdir| | |
cd rootdir do | |
Dir["*"].each do |subdir| | |
destination = "/Volumes/WD3T/ISOs/#{rootdir.shellescape}/" |
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 ruby | |
require 'fileutils' | |
include FileUtils | |
BAD_FILES = ['@eaDir', 'Thumbs.db'] | |
def transverse(dir) | |
cd dir do | |
Dir["*"].each do |d| |
NewerOlder