Skip to content

Instantly share code, notes, and snippets.

@jsc-dev
jsc-dev / bash-history-to-zsh-history.py
Created June 7, 2017 20:52 — forked from op/bash-history-to-zsh-history.py
Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | bash-history-to-zsh-history >> ~/.zsh_history
import sys
def main():
@jsc-dev
jsc-dev / remove-docker-containers.md
Created October 15, 2016 13:05 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
<?php
public function createMenu($elements, $parentId = 0) {
$branch = array();
if(count($elements)) {
foreach ($elements as $element) {
if ($element->parent_id == $parentId) {
$children = $this->createMenu($elements, $element->id);
$branch[] = array(
"id" => $element->id,
@jsc-dev
jsc-dev / multiple_owl_slider.css
Last active August 29, 2015 14:26
multiple_owl_slider
<style>
/* owl */
.owl-brand-customNav { margin-top: 20px; text-align: right;}
.owl-brand-customNav a {
/*use styles below to disable ugly selection*/
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
@jsc-dev
jsc-dev / reset_cache.txt
Last active August 29, 2015 14:24
pagespeed settings
touch /var/cache/mod_pagespeed/cache.flush
/*
* typeahead style
* https://github.com/bassjobsen/typeahead.js-bootstrap-css
* twitter typeahead fixes
* https://gist.github.com/bhays/6140058
*/
span.twitter-typeahead {
width: 100%;
}
/**
* Turns an object array into an associative multidimensional array.
*
* @param $object
* @return array|object
*/
protected function toArray($object)
{
if (is_object($object))
{
### note: vhost updated to apache 2.4
### using Require all granted, Require all denied
### instead of Allow from all, Deny from all...
<VirtualHost *:80>
ServerName demo.dev
ServerAdmin [email protected]
SetEnv MY_LARAVEL_ENV "local"
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>test</title>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="imagetoolbar" content="no" />
<title>test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script>
!window.jQuery && document.write('<script src="jquery-1.4.3.min.js"><\/script>');
</script>