Skip to content

Instantly share code, notes, and snippets.

View zulhfreelancer's full-sized avatar

Zulhilmi Zainudin zulhfreelancer

View GitHub Profile
@abitdodgy
abitdodgy / Ubuntu Setup Guide for Rails Deployment.md
Last active January 29, 2018 16:02
A guide for setting up an Ubuntu server for Rails deployment

Rails Deployment with Ubuntu 12.10, RVM, Postgresql, Nginx, and Unicorn.

This setup was used successfully on a DigitalOcean VPS. After much trial and error, and following a number of disparate guides and tutorials, I was able to distil the process to the information found in this gist.

Before getting started, you should create a new server droplet. Login to verify that everything is working correctly.

ssh root@xxx.xxx.xx.xx
@cheeaun
cheeaun / rdrc2016.md
Last active June 13, 2018 08:39
RedDotRubyConf 2016 links & resources 😘
@Andy-set-studio
Andy-set-studio / .htaccess
Created October 23, 2017 20:19
.htaccess rules to place site in maintenance mode, but allow certain IP Address through
RewriteEngine On
# Allow through given IP Address
RewriteCond %{REMOTE_ADDR} !^95\.128\.11\.149
# Check for presence of Maintenance Page
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
# Check for presence of enable file
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
@lukehedger
lukehedger / HelloYou.sol
Created November 23, 2017 15:49 — forked from anonymous/HelloYou.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.18+commit.9cf6e910.js&optimize=undefined&gist=
pragma solidity ^0.4.18;
// import './SomeContract.sol';
contract HelloYou {
event Hello(address you);
function sayHello() public {
address _person = msg.sender;
@szimek
szimek / presentation.md
Created January 24, 2012 09:51
HTTP caching in Rails

HTTP caching

Kinds of caches

  • Browser
  • Proxy
  • Gateway

TODO Difference between proxy and gateway caches.

git clone and cd function

A simple little alias function that lets you clone and cd into a GitHub repo in one command.

Installation

Add to your zsh or bash config (usually ~/.bash_profile or ~/.zshrc) and open a new terminal to be able to use the function.

Usage

gcd [github_repo_owner/repo_name]
@clarkdave
clarkdave / ecs-interactive-console.sh
Last active January 31, 2023 19:26
ecs-interactive-console
#!/bin/bash -e
##
# Use this annotated script a base for launching an interactive console task on Amazon ECS
#
# more info: https://engineering.loyaltylion.com/running-an-interactive-console-on-amazon-ecs-c692f321b14d
#
# Requirements:
# - `jq` must be installed on both the client and server
##
@dopiaza
dopiaza / slackpost
Created September 5, 2013 12:33
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@gregorynicholas
gregorynicholas / email-spreadsheet-as-pdf-invoice.js
Last active April 14, 2023 22:18
google apps script to email a spreadsheet as a pdf invoice
/** Returns a PDF object based on the contents of the 'invoicing' sheet */
function invoiceToPDF(invDetails)
{
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
ssID = spreadsheet.getId();
var sheet = spreadsheet.getSheetByName(INVOICES_SHEETNAME);
var gid = sheet.getSheetId();
// &gid=x at the end of above url if you only want a particular sheet
var url2 = "http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=" + ssID +
@soundTricker
soundTricker / convertDocs2Html.js
Created February 1, 2013 00:28
Convert Google Docs 2 Html on Google Apps Script GASでGoogle DocumentのファイルをHTMLに変換します。
var KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; //developer key , get from https://code.google.com/apis/console/b/1/
var FILE_ID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // drive file id
function convertDocuments2() {
var oauthConfig = UrlFetchApp.addOAuthService('drive');
//Create oauth config for drive api
var scope = 'https://www.googleapis.com/auth/drive';
oauthConfig.setConsumerKey('anonymous');
oauthConfig.setConsumerSecret('anonymous');