Skip to content

Instantly share code, notes, and snippets.

View daltonjorge's full-sized avatar

Dalton Jorge daltonjorge

  • UFCG
  • Brazil - Paraiba - Campina Grande
View GitHub Profile
@mlabrum
mlabrum / gitpush.txt
Created September 18, 2011 06:13
Setting up GIT push to live website on a windows server
------------------
How to setup git based push to live webserver on windows with apache
------------------
1) Install http://code.google.com/p/msysgit/
2) Setup your git directories
# Setup a base git directory
mkdir c:/server/git
git init --bare www.git
@kmizu
kmizu / Example.mini
Created November 14, 2011 16:22 — forked from kishida/MiniParser.scala
Toy language with parser combinators of scala, which is derived from Kishida-san's code. Original language has dynamic scope. But It has static scope and so-called lexical closure.
val factorial = (n) => {
if(n < 2) 1 else (n * factorial(n - 1));
};
println("factorial(3) = " + factorial(3));
def mkcounter(n) = () => {
n = n + 1;
n
};
val counter = mkcounter(6);
@v-yarotsky
v-yarotsky / .tmux.conf
Created March 22, 2012 11:57
Mac OS X tmux config
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Put itunesartist and itunestrack into PATH
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 17, 2024 01:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active November 14, 2024 17:18
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@sofoklis
sofoklis / LogiclaExpressionParser.scala
Last active December 9, 2020 12:40
Parser Combinators - A logical expression parser
package org.papasofokli
import scala.util.parsing.combinator.JavaTokenParsers
/**
* <b-expression>::= <b-term> [<orop> <b-term>]*
* <b-term> ::= <not-factor> [AND <not-factor>]*
* <not-factor> ::= [NOT] <b-factor>
* <b-factor> ::= <b-literal> | <b-variable> | (<b-expression>)
*/
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active November 14, 2024 09:13
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@aeischeid
aeischeid / ErrorController.groovy
Last active May 28, 2019 16:08
Alternate grails controller template and url mapping for adding a scaffolded JSON API
package gvl
import grails.converters.JSON
class ErrorController {
// Forbidden
def error403() {
withFormat {
html { render(view: 'error403') }
@hpcorona
hpcorona / squid.conf
Created March 1, 2013 16:06
simple squid3 configuration to allow all to connect to all
#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
@imjayson
imjayson / Grails: createCriteria query, group by day, on a single date field
Last active October 23, 2019 14:57
Grails: createCriteria query, group by day, on a single date field (modify for grouping by month, year, hour, minute, seconds)
DOMAIN CLASS (Post):
String timeDay
Date date
static mapping = {
timeDay formula: "FORMATDATETIME(date, 'yyyy-MM-dd')" // h2 sql
//timeMonth formula: "DATE_FORMAT(time, '%Y-%m-%d')" // mysql sql
}
CONTROLLER:
def c = Post.createCriteria()