Skip to content

Instantly share code, notes, and snippets.

View sky4git's full-sized avatar

Sky4git sky4git

  • Melbourne, Australia
View GitHub Profile
----------- Example 1 for Google Fonts ----------------------------------
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js"></script>
<script>
WebFont.load({
google: {
families: ['Droid Sans', 'Droid Serif']
}
});
</script>
------------- Example 2 for Typekit------------------------------------
@sky4git
sky4git / package.json
Last active August 23, 2016 12:05
ReactJS Environment setup
{
"name": "react-setup",
"version": "1.0.0",
"description": "Setting up ReactJS Development Environment",
"main": "index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"ReactJS"
@sky4git
sky4git / fix.txt
Created June 26, 2016 23:44
Linux NPM no /usr/bin/env found fix
>> Create a symlink - probably with sudo and try run you npm commands
ln -s /usr/bin/nodejs /usr/bin/node
@sky4git
sky4git / commands.sh
Last active March 22, 2016 20:10
Artisan commands Laravel
## make controller ##
php artisan make:controller PhotoController
## make controller with resource ##
php artisan make:controller PhotoController --resource
## make migrations
php artisan make:migration create_users_table
## Run migration
php artisan migrate
## Create a service provider
php artisan make:provider RiakServiceProvider
@sky4git
sky4git / Compiled.js
Last active February 28, 2016 00:43
JSX syntax
// COMPILED JSX SYNTAX INTO JAVASCRIPT
// main container component
var Container = React.createClass({displayName: "Container",
render: function() {
return(
React.createElement("div", null,
React.createElement(PostsGroupJSON, {source: "ajax/ajaxjson.html"}),
React.createElement(PostsGroupHTML, {source: "ajax/ajaxdemo.html"})
)
);
@sky4git
sky4git / index.html
Created February 28, 2016 00:10
A sample React app - Dynamic Box
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>dynamic Width Example!</title>
<script src="build/react.js"></script>
<script src="build/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
<script type="text/babel" src='main.js'></script>
</head>
@sky4git
sky4git / jquery.addrule.js
Created November 24, 2015 00:47 — forked from yckart/jquery.addrule.js
Add css-rules to an existing stylesheet - http://stackoverflow.com/a/16507264/1250044
/*!
* jquery.addrule.js 0.0.2 - https://gist.github.com/yckart/5563717/
* Add css-rules to an existing stylesheet.
*
* @see http://stackoverflow.com/a/16507264/1250044
*
* Copyright (c) 2013 Yannick Albert (http://yckart.com)
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
* 2013/11/23
**/
@sky4git
sky4git / gist:c6aab65da059956935c5
Created October 13, 2015 06:09
Configure Jira with Apache2 Mod_proxy
Insert following in file /opt/atlassian/jira/conf/server.xml
below the main connector
<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8080" protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true" 
proxyName="jira.atlassian.com" proxyPort="80"/>
Restart Jira:
sudo service jira stop
sudo service jira start
-----------------------------------------------------------------------
Insert in /etc/apache2/sites-enabled/000-default.conf
@sky4git
sky4git / git-svn commands
Last active September 28, 2016 10:59
Git SVN Wordpress steps
Follow first steps from
http://teleogistic.net/2010/09/10/using-github-with-wordpress-org-plugin-svn/
https://teleogistic.net/2011/05/23/revisiting-git-github-and-the-wordpress-org-plugin-repository/
# Run commands by steps
1: git rebase trunk
2: git svn dcommit
3: git svn tag 1.1
4: git tag -a 1.1 -m "Tagging 1.1" [optional]
5: git push --tags
@sky4git
sky4git / .htaccess
Created August 11, 2015 12:11
Spam referrers list & block in htaccess
# Start HackRepair.com Blacklist
RewriteEngine on
# Start Abuse Agent Blocking
RewriteCond %{HTTP_USER_AGENT} "^Mozilla.*Indy" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Mozilla.*NEWT" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^$" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Maxthon$" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^SeaMonkey$" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Acunetix" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^binlar" [NC,OR]