Skip to content

Instantly share code, notes, and snippets.

View 0x00dec0de's full-sized avatar

Sukhorukov Olexandr 0x00dec0de

View GitHub Profile
# Add the zfs filesystem to the install environment:
nano /etc/nixos/configuration.nix
## ---8<-------------------------8<---
boot.supportedFilesystems = ["zfs"];
## ---8<-------------------------8<---
nixos-rebuild switch
# Load the just installed ZFS kernel module
@0x00dec0de
0x00dec0de / main.css
Last active August 29, 2015 14:16
slider
#billboard {
width:100%;
min-height: 700px;
position:relative;
}
.slide {
color:white;
position:absolute;
width:100%;
@charset "UTF-8";
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
@0x00dec0de
0x00dec0de / animate-css.js
Created March 2, 2015 17:02
Animation when scrolling.
//Animate CSS + WayPoints javaScript Plugin
//Example: $(".element").animated("zoomInUp", "zoomOutDown");
//Author URL: http://webdesign-master.ru
(function($) {
$.fn.animated = function(inEffect, outEffect) {
$(this).css("opacity", "0").addClass("animated").waypoint(function(dir) {
if (dir === "down") {
$(this).removeClass(outEffect).addClass(inEffect).css("opacity", "1");
} else {
$(this).removeClass(inEffect).addClass(outEffect).css("opacity", "1");
// more about the angular promises see on the http://habrahabr.ru/post/221111/ (doc on russian language)
// The promise need be using when a function run as async function.
var app = angular.module('app', []);
app.controller('testController',['$scope','$q',function($scope, $q){
$scope.addOne = function(num){
$scope.step++;
console.log( num );
@0x00dec0de
0x00dec0de / angular-cut.js
Last active December 3, 2015 07:01
cuts from angularjs
$routeProvider.otherwise({ redirectTo: '/' });
// Resolve Response
$provide.factory('HttpInterceptor', [ '$q', '$rootScope', '$location', function( $q, $rootScope, $location ) {
return {
request: function (config) { // On request success
return config || $q.when(config); // Return the config or wrap it in a promise if blank.
},
requestError: function (rejection) { // On request failure
# The Nginx configuration based on https://coderwall.com/p/rlguog
http {
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 15m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
## File used for defining $PS1
##-ANSI-COLOR-CODES-##
# Reset
Color_Off='\e[0m' # Text Reset
# Regular Colors
Black='\e[0;30m' # Black
Red='\e[0;31m' # Red
Green='\e[0;32m' # Green
@0x00dec0de
0x00dec0de / email grabber
Created October 15, 2015 13:26
email grabber
#!ruby
require 'net/http'
require 'uri'
def scrapEmails( urlString )
url = URI.parse( urlString )
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
emails = res.body.scan( /[A-Za-z0-9]+[@ | (at) | (AT) ][A-Za-z0-9]+\.[A-Za-z]+/i )
return emails
@0x00dec0de
0x00dec0de / scj2innodb.sh
Created October 15, 2015 13:29
sch to inoddb
#!/bin/bash
TMPFILE=`mktemp tmp.XXXXXXXXX`
MYSQL=`which mysql`
PANEL=`hostname |cut -b3-4`
#echo $PANEL
if [ "$PANEL" = "wm" ]; then
MYPASS=`cat /root/mysql_passwd`
elif [ "$PANEL" = "da" ]; then