Skip to content

Instantly share code, notes, and snippets.

View dip00dip's full-sized avatar

Denys Pankratov dip00dip

  • Consultant
  • Lviv, Ukraine
View GitHub Profile
@thomd
thomd / local POP3 on OSX
Created November 16, 2009 00:17
install a local POP3 server on OSX serving the system mailbox as a POP3 account.
#!/bin/sh
#
# install a local POP3 server on OSX serving the system mailbox as a POP3 account.
#
# get pre-compiled OS X binaries of UW's (University of Washington) ipop3d and imapd.
cd ~
curl -L -O http://www.macosxguru.net/downloads/localmail.zip
unzip localmail.zip
@funny-falcon
funny-falcon / load.c.patch
Created October 8, 2011 22:30
Patch against ruby-1.9.3-p0 to futher improve load.c
diff --git a/load.c b/load.c
index 0ff4b60..019ccb9 100644
--- a/load.c
+++ b/load.c
@@ -18,6 +18,7 @@ VALUE ruby_dln_librefs;
#define IS_DLEXT(e) (strcmp((e), DLEXT) == 0)
#endif
+static int sorted_loaded_features = 1;
@tjh
tjh / character_set_and_collation.rb
Created January 31, 2012 16:07
Convert all Rails table column collation and character set
#!/usr/bin/env ruby
# Put this file in the root of your Rails project,
# then run it to output the SQL needed to change all
# your tables and columns to the same character set
# and collation.
#
# > ruby character_set_and_collation.rb
DATABASE = ''
@mattgorecki
mattgorecki / trapd.rb
Created June 7, 2012 15:59
Simple SNMP Trap receiver that dumps to a RabbitMQ queue
require 'rubygems'
require 'snmp'
require 'carrot'
require 'json'
q = Carrot.queue('traps', :durable => true)
m = SNMP::TrapListener.new(:Port => 162, :Community => 'snmpcommunity') do |manager|
puts "trapd.rb started..."
manager.on_trap_default do |trap|
@jhjguxin
jhjguxin / Rakefile
Created June 20, 2012 05:26
how to resque
#No such file to load -- devise/confirmations_controller
#resque worker devise not eager loading
require File.expand_path('../config/application', __FILE__)
require 'rake/dsl_definition'
require 'resque/tasks'
Askjane::Application.load_tasks
task "resque:setup" => :environment do
@willurd
willurd / web-servers.md
Last active July 28, 2024 14:39
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@estum
estum / switch_on.rb
Last active August 8, 2023 05:52
Ruby alternative switch-case syntax.
# = Kernel#switch
# Provides alternative switch-case syntax.
#
# # support methods:
# value = []
# switch value do
# on empty?: -> { "none" }
# on one?: -> { "one" }
# on many?: -> { "many" }
# end
@erineland
erineland / exportsafarireadinglist.sh
Last active January 19, 2020 00:58
Export Safari's Reading List to Pocket/Evernote (or any service with an "email content in" feature)
#!/bin/bash
# Script to export Safari's reading list into a text file, then import this into Pocket or Evernote (or any service with a "email in content" feature).
# First take all of Safari's Reading List items and place them in a text file.
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' > readinglistlinksfromsafari.txt
# Now loop over each of those URls within that text file and add them to pocket.
while IFS= read -r line
do
echo $line

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@peterjmag
peterjmag / react-native-talk.md
Last active June 21, 2021 10:13
Let's build a React Native app in 20 minutes - React Berlin #1 (April 2015)