Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
I LIEK TURTLES

Alex Zinchenko yumitsu

🐢
I LIEK TURTLES
  • St. Petersburg, Russia
View GitHub Profile
View formula-example.rb
# This is a non-functional example formula to showcase all features and
# therefore, it's overly complex and dupes stuff just to comment on it.
# You may want to use `brew create` to start your own new formula!
# Documentation: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md
## Naming -- Every Homebrew formula is a class of the type `Formula`.
# Ruby classes have to start Upper case and dashes are not allowed.
# So we transform: `example-formula.rb` into `ExampleFormula`. Further,
# Homebrew does enforce that the name of the file and the class correspond.
# Check with `brew search` that the name is free.
@yumitsu
yumitsu / # remake - 2020-07-06_15-16-07.txt
Created Jul 6, 2020
remake on macOS 10.13.6 - Homebrew build logs
View # remake - 2020-07-06_15-16-07.txt
Homebrew build logs for remake on macOS 10.13.6
Build date: 2020-07-06 15:16:07
@yumitsu
yumitsu / digest.rb
Created Jan 21, 2018 — forked from jfcalvo/digest.rb
Hash of files an strings with Ruby using MD5 and SHA256
View digest.rb
require 'digest'
# Get SHA256 Hash of a file
puts Digest::SHA256.hexdigest File.read "data.dat"
# Get MD5 Hash of a file
puts Digest::MD5.hexdigest File.read "data.dat"
# Get MD5 Hash of a string
puts Digest::SHA256.hexdigest "Hello World"
# Get SHA256 Hash of a string using update
View sed cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
View gist:fde8f1ae6b732caa5e257f6dd5e083f3
java.io.FileNotFoundException: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunmscapi.jar (No such file or directory)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.zip.ZipFile.<init>(ZipFile.java:169)
at com.javadeobfuscator.deobfuscator.utils.Utils.loadBytes(Utils.java:390)
at com.javadeobfuscator.deobfuscator.utils.TransformerHelper.newVirtualMachine(TransformerHelper.java:159)
at com.javadeobfuscator.deobfuscator.transformers.stringer.v3_1.StringEncryptionTransformer.transform(StringEncryptionTransformer.java:39)
at com.javadeobfuscator.deobfuscator.Deobfuscator.runFromConfig(Deobfuscator.java:325)
at com.javadeobfuscator.deobfuscator.Deobfuscator.start(Deobfuscator.java:285)
View free-memory.rb
#!/usr/bin/env ruby
# encoding: utf-8
# By Uğur Özyılmazel, @vigobronx | @ugurozyilmazel
# http://vigodome.com | http://ugur.ozyilmazel.com | http://github.com/vigo
def get_paged_memory_usage(match_string, paging=4096)
mvar = 3
if match_string.split(/[^\w]/).length > 1
mvar = 4
View namespace.coffee
window.namespace = ->
args = arguments[0]
target = global || window
loop
for subpackage, obj of args
target = target[subpackage] or= {}
args = obj
break unless typeof args is 'object'
Class = args
View mobile-device.js
// Tests: http://jsfiddle.net/yumitsu/k18fkfgt/
var MobileDevice = {
init: function() {
var j, device, _this = this;
device = {
'mobile': _this.isMobileDevice(),
'mobileDimensions': _this.isDimsMatching(),
'webkit': _this.isWebKitDevice(),
'mobileSafari': _this.isMobileSafari(),
View Vagrantfile
Vagrant.configure(2) do |config|
config.vm.define "boot2docker"
config.vm.box = "parallels/boot2docker"
config.vm.box_check_update = false
config.ssh.private_key_path = [
'~/.vagrant.d/insecure_private_key',
'~/.ssh/id_rsa'
]
View angularjs-interceptor.js
// Intercepting HTTP calls with AngularJS.
angular.module('MyApp', [])
.config(function ($provide, $httpProvider) {
// Intercept http calls.
$provide.factory('MyHttpInterceptor', function ($q) {
return {
// On request success
request: function (config) {
// console.log(config); // Contains the data about the request before it is sent.
You can’t perform that action at this time.