Skip to content

Instantly share code, notes, and snippets.

@dskanth
dskanth / app.js
Created May 8, 2012 10:56
Server file for Private chat using node.js and socket.io
var app = require('express').createServer()
var io = require('socket.io').listen(app);
var fs = require('fs');
app.listen(8008);
// routing
app.get('/', function (req, res) {
res.sendfile(__dirname + '/chat.html');
});
@adamgit
adamgit / .gitignore
Last active April 8, 2024 12:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@mdesantis
mdesantis / schedule.rb
Last active May 28, 2023 16:11
Schedule script for using Whenever toghether with rbenv
# Schedule script for using Whenever toghether with rbenv
#
# Whenever: https://github.com/javan/whenever
# rbenv: https://github.com/sstephenson/rbenv
set :env_path, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"'
# doesn't need modifications
# job_type :command, ":task :output"
@benelog
benelog / Volley.md
Last active October 20, 2023 02:05
Volley 설명

안드로이드 개발에서 많은 비중을 차지하는 UI패턴은 ListView에서 여러 이미지를 보여주는 Activity입니다. 전형적인 흐름을 정리하면 아래와 같습니다.

​1. 목록조회 API호출

​2. API를 파싱하고 ListView에 데이터를 보여 줌.

​3. 각 아이템마다의 이미지 주소로 다시 서버를 호출

​4. 이미지를 디코딩하고 ImageView에서 보여줌.

@kujohn
kujohn / portforwarding.md
Last active April 27, 2024 20:16
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@iainconnor
iainconnor / Android Studio .gitignore
Created January 24, 2014 20:20
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@kylemcdonald
kylemcdonald / post-server.py
Created September 21, 2014 01:24
Python POST simple server
import SimpleHTTPServer
import SocketServer
PORT = 8000
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_POST(self):
content_len = int(self.headers.getheader('content-length', 0))
post_body = self.rfile.read(content_len)
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@yuki24
yuki24 / .gitignore
Last active November 9, 2021 16:15
jbuilder vs ActiveModel::Serializers
log/
@iangreenleaf
iangreenleaf / gist:b206d09c587e8fc6399e
Last active April 21, 2024 02:41
Rails naming conventions

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.