Skip to content

Instantly share code, notes, and snippets.

View rothanachoun's full-sized avatar
🎯
Focusing

Rothana Choun rothanachoun

🎯
Focusing
View GitHub Profile
@rothanachoun
rothanachoun / claude_rubocop_hook.json
Created July 4, 2025 03:06 — forked from justindell/claude_rubocop_hook.json
Using Claude Code Hooks to automatically run rubocop --auto-correct on Ruby files
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "FILE_PATH=$(jq -r '.tool_input.file_path // empty'); if [[ \"$FILE_PATH\" =~ \\.(rb|rake)$|Rakefile$|Gemfile$ ]]; then echo \"Running RuboCop on $FILE_PATH\"; bundle exec rubocop --autocorrect \"$FILE_PATH\"; fi"
}
]
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: python-helloworld
spec:
schedule: "*/1 * * * *"
concurrencyPolicy: "Forbid"
jobTemplate:
spec:
template:
;(function () {
'use strict';
angular
.module('listing')
.controller('PostsNewController', PostsNewController);
PostsNewController.$inject = [
'$rootScope',
'$state',
# frozen_string_literal: true
require 'google/apis/analytics_v3'
module Api
module V1
module GoogleAnalytics
class Service
MAX_PROPERTIES = 50
AUTHORIZE_URL = 'https://accounts.google.com/o/oauth2/auth'
# == Schema Information
#
# Table name: listing_posts
#
# id :integer not null, primary key
# title :string(255)
# content :text(65535)
# published :boolean default(TRUE)
# featured :boolean default(FALSE)
# featured_order :integer
@rothanachoun
rothanachoun / laravellocal.md
Created March 5, 2017 09:24 — forked from hootlex/laravellocal.md
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
# update post content
Image.all.each do |image|
old_image_path = '/images/large/' + image.attachment_file_name
new_image_path = '/images/' + image.id.to_s + '/large/' + image.attachment_file_name
Post.all.each do |post|
post.content = post.content.gsub(old_image_path, new_image_path)
post.save!
end
@rothanachoun
rothanachoun / imagemagick-install-steps
Created October 22, 2015 14:26 — forked from rodleviton/imagemagick-install-steps
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
@rothanachoun
rothanachoun / installation.sh
Created October 13, 2015 17:15 — forked from mikhailov/installation.sh
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
@rothanachoun
rothanachoun / gist:6bffe8f5c6b51b1996e6
Last active August 29, 2015 14:28 — forked from kinnala/gist:6376196
Soccerway API scraping example
import urllib2
import json
import re
class SoccerwayTeamMatches:
def __init__(self, teamId):
self.teamId = str(teamId)
self.data = {'all': [], 'home': [], 'away': []}