Skip to content

Instantly share code, notes, and snippets.

View obahareth's full-sized avatar
🧉
In the Zone

Omar Bahareth obahareth

🧉
In the Zone
View GitHub Profile
/* Taken zigmob's (http://forums.macrumors.com/showthread.php?t=1742566) workaround a step further
And added some triggers to clean up these dodgy character combinations (ff, fi, fl).
Still crashes on initial message read but saves having to manually run the sql query eve time a message contains the character combinations */
-- Working well for me so far --
CREATE TRIGGER insert_Ff AFTER INSERT ON ZWAMESSAGE
BEGIN
UPDATE ZWAMESSAGE
SET ZTEXT = replace( ZTEXT, 'ff', 'f f')
WHERE ZWAMESSAGE.ZTEXT like '%ff%';
@pincheira
pincheira / homebrew.rb
Last active July 1, 2016 17:07
Working version of Homebrew for OS X 10.10

Working version of Homebrew for OS X 10.10

The only way to get working Homebrew on OS X 10.10 for now (10.10 beta was just released a couple of hours ago) is by using an special fork by @jacknagel available at https://github.com/jacknagel/homebrew/tree/rb2.

To install this working version of Homebrew just execute:

ruby -e "$(curl -fsSL https://gist.githubusercontent.com/jpincheira/bd3698fee46735fac252/raw/2c6a2f81927871c1a64e2dfbbc5eef451c71a9ac/homebrew.rb)"

@davidbanham
davidbanham / rack-angular-xsrf.rb
Last active December 1, 2016 14:34
Angular XSRF rack middleware
class TokenAdder
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
response = Rack::Response.new body, status, headers
require 'net/http'
require 'uri'
require 'json'
require 'cgi'
@mutex = Mutex.new
def query(query)
uri = URI.parse("https://www.amazon.de/gp/search-inside/service-data")
http = Net::HTTP.new(uri.host, uri.port)
require 'net/http'
require 'uri'
require 'json'
require 'cgi'
def lcs(a, b)
lengths = Array.new(a.length) { Array.new(b.length, 0) }
greatest_length = 0
output = ''
a.each_char.with_index do |x, i|
@Angles
Angles / Open-source-iOS-apps.md
Created July 25, 2012 19:21
real iOS apps with GitHub open source repos

Real iOS Apps in AppStore, with source on GitHub:

thanks 4 putting source for a noob to learn a little

I've used these:

@goncalvesjoao
goncalvesjoao / Gemfile
Last active November 13, 2020 01:52
Changes you need to make in order to make Devise use JWT Header Authentication
# Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile"
gem 'jwt'
@markshust
markshust / hosts
Last active February 12, 2021 22:20
Notion DNS servers in the event of an outage...
# Add the following records to your DNS config
## Mac: /etc/hosts
## Windows: C:\Windows\System32\drivers\etc\hosts
104.18.23.110 admin-stg.notion.so
104.18.23.110 aif.notion.so
104.18.23.110 analytics-iframe.notion.so
104.18.23.110 analytics.pgncs.notion.so
104.18.23.110 api.notion.so
104.18.23.110 api.pgncs.notion.so
104.18.23.110 dev.notion.so
@munificent
munificent / gist:9749671
Last active June 23, 2022 04:04
You appear to be creating a new IDE...
You appear to be advocating a new:
[ ] cloud-hosted [ ] locally installable [ ] web-based [ ] browser-based [ ] language-agnostic
[ ] language-specific IDE. Your IDE will not succeed. Here is why it will not succeed.
You appear to believe that:
[ ] Syntax highlighting is what makes programming difficult
[ ] Garbage collection is free
[ ] Computers have infinite memory
[ ] Nobody really needs:
@czj
czj / Gemfile
Last active August 28, 2022 09:06
Outputting Rails app logs to Logz.io via logstash
gem "lograge"
gem "logstash-event"
gem "logstash-logger"