This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Linux | |
class User | |
class << self | |
# Generate an MD5 salt string | |
def salt | |
seeds = ('a'..'z').to_a | |
seeds.concat( ('A'..'Z').to_a ) | |
seeds.concat( (0..9).to_a ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dragonfly' | |
# Adding image_optim to Dragonfly | |
image_optim = ImageOptim.new(nice: 20, threads: 4, verbose: true, advpng: { level: 4 }, jpegoptim: { strip: :all }, jpegrecompress: { quality: 2 }, optipng: { level: 4 }, pngcrush:{ chunks: :alla } ) | |
# Configure | |
Dragonfly.app.configure do | |
plugin :imagemagick | |
# Image optimization processor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctrl.createField = function (e) { | |
e.preventDefault(); | |
ctrl.vm.ContractSectionId = args.contractSection.Id; | |
var saveField = function () { | |
return Field.save(ctrl.vm).result | |
} | |
saveField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list: | |
- name: Adobe Systems | |
name2: Adobe Systems Inc. | |
url: http://www.adobe.com | |
symbol: ADBE | |
price: 39.26 | |
change: 0.13 | |
ratio: 0.33 | |
- name: Advanced Micro Devices | |
name2: Advanced Micro Devices Inc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sunspot' | |
require 'sunspot/rails' | |
require 'feedjira/feed' | |
module Sunspot | |
module Feedjira::Feed | |
def self.included(base) | |
base.class_eval do | |
extend Sunspot::Rails::Searchable::ActsAsMethods | |
Sunspot::Adapters::DataAccessor.register(DataAccessor, base) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
DOMAIN="$1" | |
UUID=$(sudo virsh dumpxml $DOMAIN | grep uuid | cut -d">" -f2 | cut -d"<" -f1) | |
DISK_LOCATION=$(sudo virsh domblklist "$DOMAIN" | grep sda | tr -s " " | cut -d" " -f2-) | |
# Export Borg encryption key | |
export BORG_PASSPHRASE="<your key>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
source "https://rubygems.org" | |
gem "benchmark-ips" | |
gem "rr" | |
gem "mocha" | |
gem "simple_mock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"net/http/cgi" | |
"os" | |
) | |
type Handler func(http.ResponseWriter, *http.Request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"log" | |
"os/exec" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import errno | |
import os | |
import subprocess | |
import sys | |
import shutil | |
import glob | |
import tarfile | |
import os.path |
OlderNewer