Skip to content

Instantly share code, notes, and snippets.

[foohey@foo-arch ~]$ whois microsoft.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Server Name: MICROSOFT.COM.ZZZZZZZZZZZZZZZZZZZZZZ.IS.A.GREAT.COMPANY.ITREBAL.COM
IP Address: 97.107.132.202
[foohey@foo-arch ~]$ whois google.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Server Name: GOOGLE.COM.ZZZZZZZZZZZZZZZZZZZZZZZZZZ.HAVENDATA.COM
IP Address: 50.23.75.44
module ArticleAccess
extend ActiveSupport::Concern
included do
protect do |user, article|
## Guests
scope { where("publish_at < '#{Time.now}'") }
can :view
@m4tm4t
m4tm4t / gist:6113155
Created July 30, 2013 14:02
sort array php
<?php
$array = array('abc', 'zabc', 'zbac', 'bouh', 'AbC', 'Zoubidou');
$array_size = count($array);
for ($i=0; $i < $array_size; $i++) {
for ($j=1; $j < $array_size; $j++) {
$holder = $array[$j];
if (strtolower($array[$j]) < strtolower($array[$j-1])) {
[Unit]
Description=Copier le noyau EFISTUB sur la partition système UEFI.
[Path]
PathChanged=/boot/vmlinuz-linux
PathChanged=/boot/initramfs-linux.img
PathChanged=/boot/initramfs-linux-fallback.img
[Install]
WantedBy=multi-user.target
[Unit]
Description=Copier le noyau EFISTUB sur la partition système UEFI.
[Service]
Type=oneshot
ExecStart=/bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/arch/vmlinuz-arch.efi
ExecStart=/bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/arch/initramfs-arch.img
ExecStart=/bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/initramfs-arch-fallback.img
#!/usr/bin/env ruby
# Ecryptfs Openbox pipemenu
# Usage: <menu id="ecryptfs" label="Dossiers cryptés" execute="~/.config/openbox/ecryptfs-menu Documents" />
def mount_menu
print <<EOF
<openbox_pipe_menu>
<item label="Monter le dossier privé">
@m4tm4t
m4tm4t / gist:5208178
Last active December 15, 2015 05:19
Regex for sublime text that replace css background url for Rails
/*
FIND WITH: url\(images\/([a-zA-Z\w+\-.]+)\)?
*/
div {
background: url(images/ui-bg_glass_75_ffffff_1x400.png);
}
/*
REPLACE WITH: url(image-path("\1"))
*/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>TestConsoleTheme</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
class Users::SessionsController < Devise::SessionsController
respond_to :xml
before_filter :init_faye_client, if: "TEST_JABBER_INTEGRATION == true"
after_filter :close_faye_client, if: "TEST_JABBER_INTEGRATION == true"
def init_faye_client
@client = Faye::Client.new('http://localhost:9292/faye')
end