Skip to content

Instantly share code, notes, and snippets.

View onemanstartup's full-sized avatar
👋

Dmitriy Plekhanov onemanstartup

👋
View GitHub Profile
@onemanstartup
onemanstartup / SketchSystems.spec
Last active December 15, 2019 03:28 — forked from rgraves-aspiration/SketchSystems.spec
Aspiration App Logic
Aspiration App Logic
open app from home screen -> Has User Previously Logged In?
Logged Out Flow
Has User Previously Logged In?
yes -> Is Device Authentication Set Up?
no -> App Welcome Screen
App Welcome Screen
tap login -> Is Device Authentication Set Up?
@onemanstartup
onemanstartup / SketchSystems.spec
Created December 15, 2019 03:22
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
@onemanstartup
onemanstartup / disable.sh
Created February 12, 2018 14:54
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
@onemanstartup
onemanstartup / 1_wof_bundle_russia_85632685_country-venue.geojson
Created July 19, 2017 13:31
WOF bundle: country, venue descendants of Russia
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
require 'benchmark'
# user system total real
# 2.150000 0.200000 2.350000 ( 2.397291)
# 2.830000 0.160000 2.990000 ( 3.060009)
# user system total real
# 2.130000 0.160000 2.290000 ( 2.324952)
# 2.810000 0.170000 2.980000 ( 3.022856)
#1000
#1000
# You don't actually need this.
# I wrote this, but rails support this
# Use store_accessor :data, :admin
module JsonAccessor
extend ActiveSupport::Concern
module ClassMethods
def json_accessor(json_attribute, *fields)
send(:store, json_attribute, accessors: fields)
4 user nginx;
3 worker_processes 4;
2 pid /var/run/nginx.pid;
1 worker_rlimit_nofile 1024;
6 events {
1 worker_connections 512;
2 }
3 http {
4
5 include /etc/nginx/mime.types;
@onemanstartup
onemanstartup / flashes.rb
Created November 16, 2014 07:34
flashes
def flash_success(message = nil, opts = {})
if message
flash[:success] = message
else
flash[:success] = translate '.flash.success_html'.freeze, view_assigns.symbolize_keys.merge(opts).merge(default: :"flash.default.success")
end
end
def flash_error(message = nil, opts = {})
if message
#!/usr/bin/env ruby
Process.daemon
FSCRIPT_PATH = "/Library/Frameworks/FScript.framework"
LLDB = IO.popen("lldb", "w")
def lldb(cmd)
LLDB.puts cmd
LLDB.flush
end
@onemanstartup
onemanstartup / accessable.rb
Last active August 29, 2015 14:05
accessable
module Accessable
module ::InheritedResources::BaseHelpers
def end_of_association_chain
chain = association_chain.last
if association_chain.is_a?(ActiveRecord::Relation)
apply_scopes_if_available(association_chain)
elsif chain
if method_for_association_chain
apply_scopes_if_available(chain.send(method_for_association_chain))
else