Skip to content

Instantly share code, notes, and snippets.

View ahmetabdi's full-sized avatar
:shipit:

Ahmet ahmetabdi

:shipit:
View GitHub Profile
@vitorbritto
vitorbritto / rm_mysql.md
Last active July 28, 2025 19:10
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@alxjrvs
alxjrvs / gist:4b73771294ea25feb2f7
Last active August 29, 2015 14:06
Android-motion Gotchas!

#Two Gotcha's In the @RubyMotion getting started guide for Android

##The NDK Does not Support API level L I got this error when I tried to rake device for the first time.

ERROR! It looks like your version of the NDK does not support API level L. Switch to │  7       structure: Structure
a lower API level or install a more recent NDK.
@edjames
edjames / gist:03d13a0f45987e0cf4a5
Created July 22, 2014 14:38
Multi-namespace cache handler
class MultiCache
include Singleton
attr_reader :rails_cache, :custom_cache
def initialize
@rails_cache = Rails.cache
@custom_cache = ActiveSupport::Cache::MemCacheStore.new(
'your-cache-ip-address', :namespace => 'rails4-namespace')
end
.random-color {
border-top-color: "LightCoral";
border-right-color: #a44b58;
border-bottom-color: rgb(108, 188, 134);
border-left-color: rgb(24%, 88%, 5%);
outline-top-color: hsl(88, 69%, 69%);
outline-right-color: rgba(220, 71, 132, 0.69);
outline-bottom-color: rgba(79%, 47%, 14%, 0.37);
outline-left-color: hsla(111, 31%, 38%, 0.86);
}
@cyberfox
cyberfox / entity_weirdness.rb
Last active August 29, 2015 13:59
RubyMotion entity name weirdness
# This shows the list of entities, and that they look like String objects to RubyMotion.
(main)> mapping = App.delegate.managedObjectContext.persistentStoreCoordinator.managedObjectModel.entitiesByName.keys.each_with_object({}) { |key, map| map[key.to_s] = key}
=> {"Auction"=>"Auction", "Category"=>"Category", "Entry"=>"Entry", "Host"=>"Host"}
# This is an example lookup for the Category entity, by name. It fails.
(main)> App.delegate.managedObjectContext.persistentStoreCoordinator.managedObjectModel.entitiesByName['Category']
=> nil
# Here we try to insert a new object for an entity by name, using 'Category' as a raw string. It fails, unable to locate it.
(main)> begin
@dhh
dhh / Basecamp-DDOS.md
Last active August 30, 2023 09:33
Basecamp is under network attack (DDoS)

Basecamp was under network attack

The attack detailed below has stopped (for the time being) and almost all network access for almost all customers have been restored. We're keeping this post and the timeline intact for posterity. Unless the attack resumes, we'll post a complete postmortem within 48 hours (so before Wednesday, March 26 at 11:00am central time).

Criminals have laid siege to our networks using what's called a distributed denial-of-service attack (DDoS) starting at 8:46 central time, March 24 2014. The goal is to make Basecamp, and the rest of our services, unavailable by flooding the network with bogus requests, so nothing legitimate can come through. This attack was launched together with a blackmail attempt that sought to have us pay to avoid this assault.

Note that this attack targets the network link between our servers and the internet. All the data is safe and sound, but nobody is able to get to it as long as the attack is being successfully executed. This is like a bunch of people

@jacklynrose
jacklynrose / Rakefile
Last active August 29, 2015 13:57
Simple macro like functionality for RubyMotion
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require './lib/preprocessor'
begin
require 'bundler'
Bundler.require
rescue LoadError
end
@seanlilmateus
seanlilmateus / async_await.rb
Last active December 27, 2020 08:34
whenever Rubymotion returns a symbol of the def-expr, async and await like c# will be possible
module AsyncAwait
class Task < NSOperation
def self.new(&block)
alloc.initWithBlock(block)
end
def initWithBlock(block)
init.tap do
@dphase
dphase / warpshadow.rb
Last active December 11, 2015 21:48
UIBezierPath Warped Shadow for RubyMotion, idea from http://nscookbook.com/2013/01/ios-programming-recipe-10-adding-a-shadow-to-uiview/
# =================================
# = Warped shadow for any CGLayer =
# =================================
def warpShadow(rect, offset)
size = rect.size
path = UIBezierPath.bezierPath
# Top/Right: ````|
path.moveToPoint([offset, offset])
path.addLineToPoint([size.width - offset, offset])