Skip to content

Instantly share code, notes, and snippets.

View cyxou's full-sized avatar
🚀

Alex cyxou

🚀
View GitHub Profile
@cyxou
cyxou / upgrade-jenkins.sh
Created August 11, 2015 10:46
Upgrade Jenkins on Bitnami VM
#!/bin/bash
cd /opt/bitnami
sudo ./ctlscript.sh stop
sudo cp -f apache-tomcat/webapps/jenkins.war apps/jenkins/jenkins.war.bak
sudo wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
sudo mv jenkins.war apache-tomcat/webapps/
sudo rm -rf apache-tomcat/work/Catalina/localhost
sudo rm -rf apache-tomcat/webapps/jenkins
sudo ./ctlscript.sh start
// Create an instance of our cache and set some keys. Notice that the [new] operator
// is optional since the SimpleCache (and revealing module pattern) doesn't use
// prototypical inheritance. And, we can use method-chaining to set the cache keys.
var cache = SimpleCache()
.set( "foo", "Bar" )
.set( "hello", "world" )
.set( "beep", "boop" )
;
console.log( cache.has( "beep" ) );
@cyxou
cyxou / ru.php
Created August 7, 2014 04:22
WP Affiliate Platform Russian Localisation
<?php
//Language file for Russian
// Login Widget related
define(AFF_WIDGET_TITLE, 'Affiliate Login');
define(AFF_WIDGET_LOGGED_IN_AS, 'You are logged in as:');
define(AFF_WIDGET_ACCESS_DASHBOARD, 'Access the Affiliate Dashboard');
// General
define(AFF_G_DATE, 'Дата');
var MyApp = angular.module('MyApp');
MyApp.factory('msgBus', ['$rootScope', function($rootScope) {
var msgBus = {};
msgBus.emitMsg = function(msg, data) {
data = data || {};
$rootScope.$emit(msg, data);
};
msgBus.onMsg = function(msg, func, scope) {
var unbind = $rootScope.$on(msg, func);
if (scope) {
@cyxou
cyxou / .tmux.conf
Last active August 29, 2015 14:02
.tmux.conf
# enable vi mode
setw -g mode-keys vi
# set prefix to Ctrl-a
set -g prefix C-a
unbind C-b
# set index for windows and pane to start from 1
set -g base-index 1
set -g pane-base-index 1
<snippet>
<content><![CDATA[
describe('${1:<Unit Test>}', function() {
$2
});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>desc</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<snippet>
<content><![CDATA[
before(function(${1:done}) {
$2
${3:done();}
});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>bef</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<snippet>
<content><![CDATA[
console.log($1);
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>log</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<description>console.log()</description>
</snippet>
[
{
"keys": ["alt+shift+a"], "command": "align_tab",
"args" : {"user_input" : "=/f"}
}
]
@cyxou
cyxou / jshint-jshint.sublime-snippet
Created May 30, 2014 07:18
inline jshint snippet
<snippet>
<content><![CDATA[
/* jshint ${1:expr}:${2:true} */
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>jsh</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<description>Inline JSHint</description>
</snippet>