Skip to content

Instantly share code, notes, and snippets.

View sibinx7's full-sized avatar
🏠
Working from home

Sibin Xavier sibinx7

🏠
Working from home
View GitHub Profile
@sibinx7
sibinx7 / gulpfile.js
Last active January 25, 2016 12:57
React babelify with gulp, gulp task to compile React in ES2015/ES6 mode
var gulp = require('gulp')
var browserify = require("browserify")
var babelify = require("babelify")
var source = require('vinyl-source-stream');
var livereload = require('gulp-livereload');
gulp.task("react",function(){
return browserify({
entries:'./app/assets/javascripts/react/main.js',
debug: true
})
@sibinx7
sibinx7 / .htaccess
Last active January 27, 2023 09:27
Laravel 5 application on shared hosting without copying anything from public to root directory
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
@sibinx7
sibinx7 / settings.md
Last active June 9, 2023 21:03
Windows and Ubuntu Time conflicts

Content

  • Multiple Boot Systems Time Conflicts

  • Repair corrupted files on Windows 10

Multiple Boot Systems Time Conflicts

Operating systems store and retrieve the time in the hardware clock located on your motherboard so that it can keep track of the time even when the system does not have power. Most operating systems (Linux/Unix/Mac) store the time on the hardware clock as UTC by default, though some systems (notably Microsoft Windows) store the time on the hardware clock as the 'local' time. This causes problems in a dual boot system if both systems view the hardware clock differently.

The advantage of having the hardware clock as UTC is that you don't need to change the hardware clock when moving between timezones or when Daylight Savings Time (DST) begins or ends as UTC does not have DST or timezone offsets.

@sibinx7
sibinx7 / rails_helping_file.md
Last active March 13, 2017 15:53
My Rails help file

RAILS_ENV=<env_state> rails c

ENV or > ENV["key"]

Rails Controller without assets, helpers and views

rails generate controller home index  --no-helper --no-assets --no-controller-specs --no-view-specs --no-test-framework --skip-test-unit --skip-template-engine
@sibinx7
sibinx7 / snippets.coffee
Created November 24, 2016 11:20
Angular coffee
app = angular.module 'myapp',[
'ui.router'
'ngResource'
]
app.config ($stateProvider, $urlRouterProvider) ->
# For any unmatched url, send to /route1
$urlRouterProvider.otherwise '/home'
$stateProvider.state 'home',
url: '/home'
templateUrl: 'partials/home.html'
@sibinx7
sibinx7 / helper.md
Last active July 30, 2020 10:20
Remove hash mismatch repos on ubuntu and linux mint

Hash Mispatch in Ubuntu packages

sudo rm -rf /var/lib/apt/lists/partial
sudo apt-get update -o Acquire::CompressionTypes::Order::=gz

Remove files and folders recursively on Windows powershell

Remove-Item -Recurse -Force some_dir
@sibinx7
sibinx7 / wordpress.md
Last active November 14, 2017 14:29
Wordpress Tips

Enable FTP wordpress update and plugin

define('FS_METHOD', 'direct');

Wordpress useful plugins

  • WPSiteSync for Content

Website accessability test

@sibinx7
sibinx7 / linux-shell-script.md
Last active March 1, 2020 09:15
Linux shell scripts
  • lsof -i:<PORT NAME>
  • kill $(lsof -t -i:<PORT NAME>)

Add Git branch name on Termianl

# Add Git branch and color scheme
function parse_git_branch () {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@sibinx7
sibinx7 / gulp-grunt-helpers.md
Last active August 31, 2017 17:06
Gulp and Grunt helpers
@sibinx7
sibinx7 / js-resource.md
Last active December 28, 2018 11:09
JavaScript Helper website