Skip to content

Instantly share code, notes, and snippets.

@viankakrisna
viankakrisna / package.json
Created June 8, 2016 18:24 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js'",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@viankakrisna
viankakrisna / .xsessionrc
Created July 5, 2016 20:47
Ultranav Setting in Ubuntu
xinput set-prop 11 "Synaptics Palm Detection" 1
xinput set-prop 11 "Synaptics Palm Dimensions" 5, 5
@viankakrisna
viankakrisna / dynamic-sidebars.php
Created August 23, 2016 14:35
Dynamic Sidebar
<?php
class Dynamic_Sidebars {
private $i;
private $sidebars;
function __construct(){
add_action( 'widgets_init', array( $this, 'init' ) );
@viankakrisna
viankakrisna / directory_reset_and_pull.sh
Created August 30, 2016 12:39
bash command for git resetting all directory and pull latest commit
for d in ./*/ ; do (cd "$d" && git reset --hard && git pull origin develop); done
@viankakrisna
viankakrisna / .htaccess
Created August 30, 2016 12:44
redirect domain to subfolder
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
RewriteRule ^(/)?$ blog [L]
sudo apt-get update && sudo apt-get install libmcrypt-dev && curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew && chmod +x phpbrew && sudo mv phpbrew /usr/local/bin/ && phpbrew init && [[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc && phpbrew lookup-prefix ubuntu && phpbrew install 7.0 +default && phpbrew switch php-7.0.1 && phpbrew use php-7.0.1 && php -v
document.head.innerHTML = '<style>body { margin: 0 auto; padding: 0; max-width: 30em; font-family: "Georgia"; line-height: 1.5; font-size: 1.3em} img { max-width: 100%; height: auto } svg { display: none; } </style>'
{
"ace": {
"@animatedScroll": true,
"@antialiasedfonts": false,
"@behavioursEnabled": true,
"@cursorStyle": "ace",
"@displayIndentGuides": true,
"@fadeFoldWidgets": true,
"@fontFamily": "Fira Code, monospace",
"@fontSize": 16,
module.exports = function LastFMFactory ($http, CONFIG) {
'ngInject'
return {
geo: {
getTopArtists: function () {
return $http.get(CONFIG.lastfm_url + '?format=json&method=geo.getTopArtists&country=indonesia&api_key=' + CONFIG.lastfm_key)
},
getTopTracks: function () {
}
<?php
/*
Plugin Name: Unauthorized Media Upload
*/
add_action('rest_api_init', function () {
register_rest_route('unauthorized-upload/v1', '/media', array(
'methods' => 'POST',
'callback' => 'unauthorized_upload',
));
});